Links
Twitter
Flickr
« Add an rcov c0 code coverage threshold to your cc.rb build | Main | Self hosted CI in an evening »
Saturday
Sep262009

Git pull from github

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:


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.

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

October 21, 2009 | Unregistered Commenterkira

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>