Saturday
Sep262009
Git pull from github
Saturday, September 26, 2009 at 9:56PM
When you create a new git repo at github some stuff wont be set by default. The following commands help from within the new repo on your own computer.
Namely, you wont be able to pull... but that shouldn't be a surprise for you as you're a computer programmer. You should be used to that by now.
You'll get a message like this:
To fix it use these commands:
Hooray.
N.B., if you've cloned the repo. from github you're already set up with this. It is only for when you create a repository from scratch.
Namely, you wont be able to pull... but that shouldn't be a surprise for you as you're a computer programmer. You should be used to that by now.
You'll get a message like this:
tim@thefactory:~/Documents/Development/smarterfitter(master)$ git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me either. Please
name which branch you want to merge on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details on the refspec.
If you often merge with the same branch, you may want to
configure the following variables in your configuration
file:
branch.master.remote = <nickname>
branch.master.merge = <remote-ref>
remote.<nickname>.url = <url>
remote.<nickname>.fetch = <refspec>
See git-config(1) for details.
To fix it use these commands:
git config --add branch.master.remote origin
git config --add branch.master.merge refs/heads/master
git pull
Hooray.
N.B., if you've cloned the repo. from github you're already set up with this. It is only for when you create a repository from scratch.
Tim Harding |
1 Comment | 
Reader Comments (1)
yay! exactly what i needed, thanks.
git gui also doesn't add those to the config, so they are missing when switching from the gui to command line