I am trying to push my code to my bit bucket repository but from last few days after update from bit bucket, I have to use token to push code. But I don't know where to add token. Could anyone let me know the entire process for android studio. I have also gone through with This documentation .But didn't get any idea about how to use it in android studio.
10 Answers
As for me I use android studio, I came across the same issue; where I was unable to make push command to my github repo, that is after an update of my IDE version to chipmunk.
Solution that worked for me:
Enable the Credential helper - In the IDE select File -> Settings -> Version Control -> Git -> Mark the check box for use Credential helper. Then apply changes.
Invalidate and clear caches - In the IDE select File -> Invalidate caches.

- 626
- 6
- 4
-
2Works on Mac too – Musa Baloyi Jul 22 '22 at 00:26
-
Worked for me with Linux+Github and after a recent pycharm update – ijuneja Aug 18 '22 at 15:29
-
1Invalidating and clearing caches was what did it for me. – nayriz Sep 17 '22 at 04:24
-
Its not working on WSL (2 on win 10) – Md. A. Apu Oct 03 '22 at 06:30
-
Doing this still giving error. But I've fixed this by setting origin url with token like: `git remote set-url origin https://
: – Md. A. Apu Oct 03 '22 at 06:42@github.com/ .git`
git config --global --unset credential.helper
and then git pull from terminal
git pull
then will ask your username and password

- 1,329
- 1
- 18
- 20
-
2If you use a Token add it when asked for username, then enter nothing on the password! – CryptoCode Jun 30 '22 at 18:51
-
This solution worked for me in RStudio IDE on Mac after equivalent problem emerged during a PAT changeover. – dhd Sep 09 '22 at 01:24
after several hours of research I found the best soultion for this I dont know this is the right way to use it or not. But its working fine.refer this answer...Refer this

- 480
- 1
- 3
- 13
-
10I find that 50 percent of The development time for android is dealing with bugs and errors of the ide, endless kinds of errors will happen. – Ronen Festinger Jun 08 '22 at 20:15
-
1
You may try with below flow, If you are using android studio in Windows :
File -> Settings -> Version Control -> Git / Check "User credential Helper"
It's working for me.

- 1,742
- 15
- 22
Simply update your git version :
git update-git-for-windows

- 13,077
- 10
- 22
- 49

- 35
- 6
I also encounter this problem, I am using mac and I solved it by
- cmd + space
- type keychain access
- search github
- delete the keychains found
- delete github on my android studio (android studio -> preferences -> version control -> Github)
- re add github on my android studio using new personal access token
Hope this help, Thanks

- 19
- 1
I just had the same error. I downloaded the project again and tried again, it gave an error. Then I updated the token in my GitHub account then I turned Android Studio on and off and it worked for me.

- 2,482
- 3
- 17
- 32
For Bitbucket create your "app password" on bitbucket console. Under your Avatar ->Personal Settings ->Access Management ->App Password.
Once done, copy app password and push from the terminal enter -
git remote set-url origin https://<Your_Account_Name>:<App_Password>@bitbucket.org/<Your_Account_Name>/<Repo_Name>.git
For Github create a new GitHub token, Once done copy token and push your project from the terminal :
git push
you'd be asked to input your username
Username for 'https://github.com': use actual GitHub username not email
Then you'd be asked to enter your password
Password for 'https://"username"@github.com': this is where you paste the token you just created
commit will be pushed after this

- 121
- 2
- 4
-
My case Android studio project github can use command same of answer For Bitbucket for push code again. – Papon Smc Mar 03 '23 at 07:04
Interesting case of PyCharm update:
OS: Ubuntu 18.04 In my case the PyCharm got updated and the existing open project was using older version.
Solution : Just closed the existing older PyCharm and open the project in newer version

- 133
- 1
- 5
If you're accessing with ssh key you don't need to insert credentials, you only need to clear the IDE cache. Go to "File" and then click on "Invalidate caches" and mark only the check "Clear VCS Log caches and indexes".

- 1
- 3
-
1As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 30 '23 at 09:48