Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

fatal: The current branch master has no upstream branch.

patrickholzer October 15, 2019

When I try:

$ git push

I get this in my Terminal:

fatal: The current branch master has no upstream branch

I use Terminal on Mac OS 10.15 (Catalina).

I could not find out the reason. Can you help? Thank you in advance.

2 answers

0 votes
patrickholzer February 12, 2020

Hi John, I wanted to follow up on this (if you still have time to look at it):

The output of git status is:

On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)

The "push"-command is still just hanging in my terminal… nothing happening.

thank you!

patrickholzer February 12, 2020

… and below the above output one more line:

nothing to commit, working tree clean
0 votes
John Paul K J October 15, 2019

Good day,

Its because you haven't defined the upstream branch, please try the below command instead.

$ git push origin <branch_name>

If you are trying to modify master branch it would be:-

$ git push origin master

 

Thanks!

John

patrickholzer October 16, 2019

Hi John

Thank you for your reply. I tried:

$ git push origin master

The terminal doesn't do anything. No upload.

I tried:

git commit -m "Update"

Terminal reply:

[master a3a92db] index

1 file changed, 1 insertion(+)

So far, so good. But once I try to push, nothing happens. No password request. No error message either.

Is it because I use 2-step-authentication?

Also, in my terminal I have:

git version 2.23.0

Thank you!

John Paul K J October 23, 2019

@patrickholzer 

Can you give the output of:

git status

 from your repo folder.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events