This may seem like a bit of a rudimentary issue, but I cannot seem to push from Sourcetree (windows) to a bitbucket repo for which my user is the owner.
To clarify I can log in to the repo using my browser just fine but when I push to it from Sourcetree and I enter the same details into the prompt box it fails to authenticate. I have tried using the username and email, I've even changed the password of the account but still no joy.
I also created an app password and tried using that as the password with combinations of the username and email, but no joy.
the error I am getting is:
git -c diff.mnemonicprefix=false -c core.quotepath=false
--no-optional-locks -c credential.helper= -c credential.helper="C:/Users//AppData/Local/ATLASS~1/SOURCE~1/GIT_EX~1/GIT-CR~1.EXE"
push -v --tags origin master:master fatal: HttpRequestException
encountered. An error occurred while sending the request.
remote: Invalid username or password. If your organization manages
your account or you've enabled two-step verification, create an app
password to log in: https://confluence.atlassian.com/x/9DJmMQ fatal:
Authentication failed for
'https://#bitbucket.org//.git/'
Pushing to https://#bitbucket.org//.git Completed
with errors, see above.
Any advice would be greatly appreciated
Try to add a new SSH key via Sourcetree, seems like Sourcetree is not picking up your username and password when you are using HTTP/S authentication, it can be because:
You have not added your account info in git global
You have not properly assigned credentials
Using SSH is a far preferred way:
https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html#SetupanSSHkey-ssh3
I deleted:
C:\Users\USERNAME\AppData\Local\Atlassian\SourceTree\passwd
C:\Users\USERNAME\AppData\Local\Atlassian\SourceTree\accounts.json
Inspired by this article: https://community.atlassian.com/t5/Sourcetree-questions/Getting-quot-fatal-Authentication-failed-for-quot-error/qaq-p/624663
It worked. When I restarted SourceTree it acted like it was the first time it was opened (downloaded some tools, asked me for my credentials). Once it finished, my project tabs were there, and I was able to pull/push.
Perform below steps:
Reset your password : https://id.atlassian.com/manage/change-password
Run below command from working copy
git remote set-url origin Your-repository-url-here
In order to get it worked I ended up going to Tools -> Options -> SSH Client configuration and changing it to OpenSSH. and set the path to the already generated ssh key file like C:\Users<user>.ssh\id_rsa.
Related
I'm trying to configure flow which include git repository
things to note:
i have a git server running in internal network
my jenkin running on one of the machine in the network so it can access git server through local ip
normally i would go like this with my git command
git remote add origin ssh://username#git-server-ip/path-to-folder
after that it prompt me to type in the password for the above username
and i can work on the git repo like normal
The problems:
in Jenkin i already set up credential with "username and password" type
When i paste in the ssh url into the Repository URL, it take a while and return error:
Failed to connect to repository ...
stdout: stderr: Permission denied, please try again. Permission
denied, please try again. username#git-server-ip: Permission denied
(publickey, password). fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository
exists.
i had selected credentials and double check username and password it's correct. i tried running the ls-remote command manually in the terminal
git ls-remote -h -- ssh://username#git-server-ip/path-to-folder HEAD
it prompts to input the password, i typed it in and it run normal without error
Why is the error only happens on Jenkins when i input the repo ssh url? is username and password credential the wrong approach for credential? what else should i use?
there no guide online for Jenkin with internal git ssh url as i known of
the closest i can see my problem related to is this question Jenkins Git ssh setup does not let me use username/password , but it doesn't have an accepted answer yet, and the answer suggest going with "ssh username and private key"
I am trying to setup Fastlane for iOS certificates and profile syncing in my MacBook. When I execute the command sudo fastlane match development --readonly, I get below error.
What is it actually? I guess that the terminal is blocking the prompt where I could enter the match password. I do not understand why I face this issue, also I have access to the repository.
Normally, the password would be cached in your Credential Storage (osxkeychain on Mac), but for your current user.
And you are executing that command as root.
Check:
if you have a credential helper set (with your account)
git config credential.helper
if your credentials are stored
git ls-remote https://...
# if a popup is displayed, enter your credentials there
if the same command would work if executed as you (instead of root)
I assume you have used ssh with the old macbook, are you trying now with https ?
Btw, it is not recommended to use the local fastlane, see Bundler.
I have just installed the jenkins in mac while connection bitbucket and jenkins i am getting this errors Failed to connect to repository : Command "git ls-remote -h https://abc#bitbucket.org/team/repo.git HEAD" returned status code 128:
stdout:
stderr: fatal: unable to access 'https://abc#bitbucket.org/team/repo.git/': Port number ended with 'p'
here is the screenshots
The error message in the screenshot says invalid username or password.
You need to select some credentials in the drop down to use with bitbucket.
If you haven’t configured any yet you can add them by clicking the key button called add.
Try proxy settings in jenkins or with http only in bitbucket URL.
Hope it helps.
Thanks.
Add credential :
I guess that your repository is private so you might need to add credential even if you use something like 'root' and ''.
when I am trying to clone a rails app repo I have got permission to, I am getting this issue.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Even after adding public key by generating one, I am unable to solve this.
Although I am able to clone using he https method but after making changes, the same error comes while I try to push the code.
Please suggest an answer for this.
First, cd into your .ssh directory. Open up the terminal and run:
cd ~/.ssh && ssh-keygen
Second, you need to copy this to your clipboard:
cat id_rsa.pub | pbcopy # On OSX
cat id_rsa.pub | xclip # On Linux
Third, add your newly generated ssh key to your account via the github/bitbucket website (just paste there).
Next, setup your git config:
git config --global user.name 'your_user_name'
git config --global user.email 'your_email'
Finally, restart your command line to make sure the config is reloaded.
Now, you should be able to clone and push from/to your github repository.
For more information on this, see this github page or this bitbucket page.
When attempting to clone, push, or pull over SSH with Git, you may receive one of these messages if Bitbucket couldn't authenticate with the keys that your SSH agent offered.
Here are the most common reasons why you may see these messages:
You used sudo when attempting the connection
You shouldn't use sudo when cloning, pushing, or pulling because the ssh-agent runs on the user level, not the root level.
Your public key isn't loaded into Bitbucket
To check if your public key is loaded into Bitbucket, do the following:
From Bitbucket, choose Personal settings from your avatar in the lower left.
The Account settings page displays.
Click SSH keys.
The SSH keys page shows a list of any existing keys.
If you don't have any keys listed, you can follow our Set up an SSH key documentation to set one up.
Your key isn't loaded into your SSH agent
If your SSH agent doesn't know to offer Bitbucket a key, the connection fails. You may run into this issue if you've recently restarted your system.
You can refer to this Article for more informations:
https://support.atlassian.com/bitbucket-cloud/docs/troubleshoot-ssh-issues/
Check few things.
Is the generated new key is the one your ssh agent using when trying to ssh to server.
(Your ssh agent might be using a different key than the one you generated)
use this to list currently loaded keys by agent.
ssh-add -L
You properly added public key to your repository hosting location.
The keys corresponding to above 1 and 2 should match.
Please see this article: GitHub: Generating SSH Keys. What happens when you run:
ssh -T git#bitbucket.org
?
You may have added the wrong key to authenticate with.
I faced this error when I created another repository in my local. My ssh-keys were already set up and I was trying to push code through vs code.
The issue got resolved when I git push-ed through git bash like I was doing before.
For bit bucket I think I have tried everything with ssh. I have tried the answer from this stackoverflow question as well. But it doesn't work. So finally I just changed the clone command from SSH to HTTPS and it worked. Only then it asked for password for my account.
I could commit to this repository without problem with Xcode 6. git still works fine in terminal, i can commit both locally and to the remote. In Xcode 7, I can commit locally but not remotely. it says authentication fails and it is impossible to reset the username. (it's greyed out). I have the proper username in my local git config file. I've also tried to create a new account but I end up with the same problem of not being able to enter the userName.
my git config --local --list
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
remote.origin.url=git#bitbucket.org:myUserName/myProject.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.failedTryToRename.remote=origin
branch.failedTryToRename.merge=refs/heads/master
branch.master.remote=origin
branch.master.merge=refs/heads/master
branch.master1.remote=origin
branch.master1.merge=refs/heads/master
user.name=myUserName
user.email=myUserName#gmail.com
The problem is that you are using the SSH remote URL:
remote.origin.url=git#bitbucket.org:myUserName/myProject.git
You will need to switch to the HTTPS remote URL.
git remote set-url origin https://bitbucket.org/myUserName/myProject.git
Alternatively, just give up. Stop trying to use Xcode's internal git management. (It's pretty terrible, so no harm done.) If you want a GUI, use SourceTree; it's from the same people who give you Bitbucket and works with it beautifully.