-4

I just want to be able to write:

$ git pull
// does the same as $ git pull origin master
$ git push 
// does the same as $ git push origin master

Except currently when I do $ git pull I get:

There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> master
14wml
  • 4,048
  • 11
  • 49
  • 97
  • 3
    Possible duplicate of [Make an existing Git branch track a remote branch?](https://stackoverflow.com/questions/520650/make-an-existing-git-branch-track-a-remote-branch) – Marko Gresak Aug 29 '17 at 15:03
  • 1
    The answer is in the question. – axiac Aug 29 '17 at 15:12
  • Please consider taking 15 seconds to actually _read_ the output of `git pull` that you pasted into your question. Git commands can generate confusing output, but I think this is an example of exceptionally clear feedback. – ChrisGPT was on strike Aug 29 '17 at 15:47
  • I don't appreciate your disparaging comment @Chris. Please take the time to be patient with new beginners like me, who find terminal outputs overwhelming. – 14wml Aug 31 '17 at 02:47

1 Answers1

2

It says so right there in the error message:

git branch --set-upstream-to=origin/master master

Assuming, of course, that you're on branch master locally as well.

What does setting the upstream mean?

Checking out a local branch from a remote-tracking branch automatically creates what is called a “tracking branch” (and the branch it tracks is called an “upstream branch”). Tracking branches are local branches that have a direct relationship to a remote branch. If you’re on a tracking branch and type git pull, Git automatically knows which server to fetch from and branch to merge into

Source: the Git book

14wml
  • 4,048
  • 11
  • 49
  • 97
Thomas
  • 174,939
  • 50
  • 355
  • 478