Quickly Fix Git's 'fatal: The current branch has no upstream branch' error

preview_player
Показать описание
When you crate a new Git branch and want to push that branch to GitHub or GitLab, you'll get an error that says: fatal: The current branch has no upstream branch. Fortunately, there's an easy fix.

Just set the upstream repo for your new branch:

$ git push --set-upstream origin new-branch

Once you've done that, you can perform Git push and pulls until your heart's content, and you'll never hit the "fatal: The current branch has no upstream branch" error again.
Рекомендации по теме
Комментарии
Автор

Thanks bro. Now I understand why we are using those commands
Your explanation are great

ahmadhassan
Автор

Thanks! I am new to Git and VCS, so your lesson clarified some points to me.

UdkJpBnz
Автор

Hi Cameron, how are you? I'm having lots of issues. Trying to do the same but from visual studio code. Is there any way that you could help me?

yesikaperezravelo
Автор

for me when I press enter i get
"warning: could not find UI helper 'GitHub.UI'" =(

metafisicadesinvertida