fatal: The current branch master has no upstream branch

后端 未结 23 2214
误落风尘
误落风尘 2020-11-30 16:46

I\'m trying to push one of my projects to github, and I keep getting this error:

peeplesoft@jane3:~/846156 (master) $ git push

fatal: The current branch mas         


        
相关标签:
23条回答
  • 2020-11-30 16:52

    First use git pull origin your_branch_name Then use git push origin your_branch_name

    0 讨论(0)
  • 2020-11-30 16:53

    Also you can use the following command:

    git push -u origin master
    

    This creates (-u) another branch in your remote repo. Once the authentication using ssh is done that is.

    0 讨论(0)
  • 2020-11-30 16:53

    For me the problem come from the name of my branch : "#name-of-my-branch", without "#" it's work fine!

    0 讨论(0)
  • 2020-11-30 16:54

    I had the same problem

    I resolved it that used below command

    $ git branch --set-upstream develop origin/develop
    

    and it will add a config in the config file in the .git folder.

    0 讨论(0)
  • 2020-11-30 16:54

    For me, it was because I had deleted the hidden .git folder.

    I fixed it by deleting the folder, re-cloning, and re-making the changes.

    0 讨论(0)
  • 2020-11-30 16:57

    on a very simple side, once you have other branches, you can't just use for pushing a branch

    git push
    

    But you need to specify the branch now, even if you have checkout the branch you want to push, so

    git push origin <feature_branch>
    

    Where can be even the master branch

    0 讨论(0)
提交回复
热议问题