I enabled two-factor authentication in Bitbucket, then created an app password. Where should I configure this app password in SourceTree?
Please follow the below steps suggested by Atlassian -
Source: https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/
For anyone finding this in 2021, another alternative (If you've been using other Bitbucket repositories all the while without having this problem). My issue is that I still had a very old repo still using the HTTPS git URL.
For example, issuing git remote -v in my legacy repository revealed something like:
origin https://myusername#bitbucket.org/myusername/myrepository.git (fetch)
origin https://myusername#bitbucket.org/myusername/myrepository.git (push)
Simply take the SSH version of your repository instead and set it with (using above url as an example):
git remote set-url origin git#bitbucket.org:myusername/myusername.git
You can do a sanity check by issuing git remote -v again to confirm that the new origin URL has been set.
Once this is set, you should be able to push to your remove without issues.
Simply use your app password instead of your account password when you configure the repository.
Related
I recently created a new gitlab repository, and have set up a repository deployment key with the ssh public key from my computer. I manage to clone the project with ssh, but when I try to push changes into the repository, I get returned with a fatal error:
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
In order to be able to push all the following should be implemented first
Make sure the project has been created under your username on
GitLab.com.
your Git username and email match your GitLab.com account for this
repository
the remote origin was set:
git remote add origin git#gitlab.com:user_name/work.git
an SSH public key was added to your GitLab.com account (if cloning
over using git or ssh).
ssh -T git#gitlab.com
Otherwise you could create a specific access token for the project you want to write to
The following guide could be useful https://blog.programster.org/gitlab-create-a-projects-access-token
i have tried all means to add this remote repository but i cant pull
or push when i push a git-hub repository it works what am i missing
e.gatoto#EMMANUEL MINGW64 ~/Desktop/myrepo.git (master) $ git push
origin master e.gatoto#192.168.180.27's password: fatal:
''~/Desktop/myrepo.git'' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the
repository exists.
e.gatoto#EMMANUEL MINGW64 ~/Desktop/myrepo.git (master)
List item
If you have double authentication on github you will have to create a key when pushing from remote to get access to the repository.
You will then use the key password instead of the password to your github account.
Maybe its related?
2FA give problems when pushing to GitHub
I am new with Amazon codecommit.
Following their instruction, I did some works like below
make a new IAM user with AdministratorAccess
make a new codecommit repository
install awscli and did aws configure
When I right finished those things, I could pull/push from codecommit.
However it became disabled with intellij Idea.
I did something like...
I pull a project from gitlab
git remote rm origin
git remote add origin [code commit url]
git branch --set-upstream-to origin/master
Now I type git [pull / push] origin master, I got this error message.
unable to access 'https://git-codecommit.ap-northeast-1.amazonaws.com/v1/repos/test17/': The requested URL returned error: 403
When I access this url via browser, it requires id/pw. But my IAM user account information is not working.
What should I do? Is there any way to switch gitlab and codecommit in intellij?
Thanks.
IntelliJ does not use awscli. It uses the default system shell.
From the description, it looks like push/pull does not work for the command-line git in the native shell, so the issue is not IntelliJ-related.
Probably git tries to use wrong credentials save in its credential.helper, that is why it fails.
Check git config credential.helper to see if any is configured. If there is one, try disabling it or clear the saved credentials.
From the description it looks like you are trying to connect to a CodeCommit repository in Intellij using https. To do this you need to generate GitCredentials(username/password) for your iam user in the IAM console.
Detailed steps are documented in the aws documentation: http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-gc.html
Once you have the username/password you can use those credentials to connect to your CodeCommit repository in Intellij.
Tested on a Mac. Your milage may vary!
I just ran into the same issue. MacOS stores the GIT UID and PW in the Keychain (in your Applications > Utilities Folder). I deleted all references to AWS Code Commit from the keychain, which forced me to reenter the UID & PW. This seems to have solve the problem.
As a side note: I think this happened because I revoked a prior GIT credential on AWS and created a new one. I think that the keychain was entering the old UID/PW which then failed during authentication.
First, you are going to want to create an IAM user with appropriate permissions and then create Git credentials. Then go to IntelliJ IDEA and say you are opening project from VCS with Git credentials, use the AWS git credentials you created and log in. Once you have logged in, you should be able to pull/push to the repo. If you are still having issues and have checked the credentials you are using are active, along with the IAM user those credentials are attached to have the right permissions, I would recommend creating a ticket on AWS support as there may be something wrong with your account that AWS staff will need to fix.
My laptop died and I need to code from another computer.
I am working with Heroku and I want to get the latest version of code from Heroku to another machine.
I understood that it is very recommended to get a proper remote repository using GitHub or BitBucket.
I decided to try BitBucket.
While creating my account, it asks for the old URL of my git repo. Since my machine is dead, I was hoping to fill in the heroku URL but that didn't work.
Any ideas how to proceed?
The idea is that I could pull and push my changes from either machines (when my laptop comes from repair).
You can simply clone your Heroku repository to your local machine. Then add BitBucket as a remote and push the code there.
Find out the Heroku repo url on the settings page of your app
https://dashboard.heroku.com/apps/[APP]/settings
git clone git#heroku.com:[APP].git
git remote add bitbucket ssh://git#bitbucket.org/[ACCOUNT]/[REPO].git
git push bitbucket master
I am trying out Github for Windows and I am getting the following error when I try to publish a newly created repository.
Authentication failed
Your credentials may be out of date. Please log out of the application and then log back in before retrying the operation.
Needless to say I've logged out and back in multiple times without success. I've also uninstalled and installed the latest version to no avail.
The repository is a new one I created within the application and contains only the .gitattributes, .git and README files.
I am a complete newbie to Github so it's quite possible I've messed something up during the setup process.
I was able to solve this by:
Press Settings - Open in GitShell.
git status
git push (or pull)
introduce credentials (here is the most important step, somehow git client messed up or forgot your credentials).
After giving correct credentials you can exit from git shell and use git client again.
It turns out that the problem was Github for Windows was having a problem with the password it had stored. Github support's instructions were as follows:
Log out of Github for Windows.
Change my password on github.com
Log back into Github for Windows.
I was then able to publish my changes.
Did you setup your ssh keys?
https://help.github.com/articles/generating-ssh-keys#platform-windows