Unable to update: no trackable branch

I am on Android Studio (Preview) 0.6.0 on Windows and have been trying to share my project with GitHub. I used Git Shell to initialize, add, commit, and translate a project on GitHub. But when I tried to update my project from Android Studio enter image description here I got this error:

Can't update: no tracked branch No tracked branch configured for branch master. To make your branch track a remote branch call, for example, git branch --set-upstream master origin/master 

He does offer this suggestion, but I'm not sure what to do at this point. Is there any way to fix this from Android Studio?

+58
git github android-studio
Jun 13 '14 at 23:21
source share
10 answers

So, after reading a little about how git installs the repo. I realized that I executed the command

 git push origin master 

but instead, the first time I had to run

 git push -u origin master 

which first sets upstream. Way to work!

+47
Jun 13 '14 at 23:58
source share

If I am not misleading, you just need to configure local branches to track their pairs on the source server.

Using your command line, you can try

 git checkout mybranch git branch --set-upstream-to=origin/mybranch 

This will configure something as the equivalent of your local branch on the server. I bet Android Studio is complaining about the lack of this.

If someone knows how to do this using the GUI of this IDE, that would be interesting to read. :)

+80
Jun 13 '14 at 23:51
source share

Create a new folder and run git init in it.

Then try git remote add origin <your-repository-url> .

Copy all the files in your project folder to a new folder, except for the .git folder (it may be invisible).

Then you can send your code by doing:
git add --all ; or git add -A ;
git commit -m "YOUR MESSAGE" ;
git push -u origin master .

I think it will work!

+4
Jun 13 '14 at 23:26
source share

In the same case, this works for me:

 < git checkout Branch_name > Switched to branch 'Branch_name' < git fetch > [Branch_name] Branch_name -> origin/Branch_name < git branch --set-upstream-to origin/Branch_name Branch_name > Branch Branch_name set up to track remote branch <New_Branch> from origin. 
+2
Sep 21 '17 at 17:39 on
source share

Suppose you have a local branch of "Branch-200" (or another name) and the server repository contains "origin / Branch-1". If you have a local "Branch-1" that is not associated with "origin / Branch-1", rename it to "Branch-200".

In Android Studio, checkout to "origin / Branch-1" by creating a new local branch "Branch-1", then merge the local branch "Branch-200" with you.

0
Nov 08 '17 at 15:48
source share

I got the same error, but in PyCharm, because I accidentally deleted my VCS origin. After re-adding my origin, I ran:

 git fetch 

which reloaded all my branches. Then I pressed a button to update the project, and I returned to normal.

0
Sep 08 '18 at 0:35
source share

I had the same problem when I transferred ownership of my repository to another user, at first I tried to use git branch --set-upstream-to origin/master master but the terminal complained about it after a little git branch --set-upstream-to origin/master master I used the following commands
git fetch
git branch --set-upstream-to origin/master master
git pull
and it all worked again

0
Nov 05 '18 at 10:36
source share

I ran into the same problem, so I used Git directly to port the project to GitHub.

In your android studio

Go to VCS => Git => Push: use the branch name you fixed and click the button

Note: tested for Android Studio version 3.3

0
Feb 02 '19 at 17:58
source share
 git branch --set-upstream-to=origin/master master 

Worked for me .... where I have one branch in my repo called master. The answer was "The branch wizard is configured to track the remote branch wizard from the source."

0
May 09 '19 at 19:33
source share
  git commit -m "first commit" git remote add origin <linkyourrepository> git push -u origin master 

will work!

-2
Oct. 30 '18 at 21:11
source share



All Articles