question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

fatal:The current branch master has no upstream branch

See original GitHub issue

Whenever I try to push, i get this message. Then, I go Git>Open Terminal and run: git push origin master And everything works smoothly.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
petr-ponomarenkocommented, Mar 27, 2019

Had the same issue with “The current branch master has no upstream branch” on push into empty repo on AWS SageMaker JupyterLab.

Going into Terminal, cd from home to SageMaker and than to my repo folder. Then git push origin master and after that GUI starts working for everything when a proper folder with repo is selected in the file browser extension.

It looks like AWS SageMaker presents folder ~/SageMaker as home in the browser, while git extension considers ~/ to be home dir and as a result, it can not find the folder with git repo to push.

When I select another folder in the file browser extension and then go to the git extension and try to stage and push changes, it considers that selected folder to be git repo folder, and as it is not really git repo folder it throws push failed with no error message.

Hope this might help.

1reaction
dhirschfeldcommented, Feb 26, 2019

It’s usually helpful if you provide more context than I just did it - e.g. copy and paste the exact commands you ran and the unabridged output.

Since we don’t know what you actually did, could you paste the output of the following commands:

git remote -v
git branch -vv
Read more comments on GitHub >

github_iconTop Results From Across the Web

fatal: The current branch master has no upstream branch
fatal: The current branch has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream...
Read more >
git fatal: The current branch has no upstream branch
If you see the message “the current branch has no upstream” in your command window, it means you've tried to git push to...
Read more >
How to fix fatal:the current branch master has no upstream ...
The fatal: The current branch master has no upstream branch error occurs when you have not configured git in such a way that...
Read more >
Git Fixes: The Current Branch Has No Upstream Branch
fatal: The current branch <branchname> has no upstream branch. To push the current branch and set the remote as upstream, use git push ......
Read more >
Fix Git's "fatal: no upstream branch" error quickly example
Git's 'no upstream branch' error can easily be fixed by setting the upstream branch to origin. Branch has no upstream fix commands. The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found