Ignoring the Git
git status and all those files I don't want in version control show up in the 'Untracked files' list. The obvious answer is to create a .gitignore file, but I really don't want to do it by hand, because it just doesn't seem lazy enough. So, I present to you a way to generate the .gitignore file without having to type any of the file names:
git ls-files -o --exclude-standard >> .gitignore Getting GitHub working with a new repository
So I thought I would try out git and github and see what all the cool kids are talking about. The initial setup was really easy. I got my first repository setup within minutes and was committing without any problems. Then I created a clone on my laptop and continued working. The problem arose when I tried to get this work back into the central repository and then back to my desktop. The git push was fine, but the git pull kept failing giving me the following:
neo$ 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> Having a quick search around the net, told me that I needed to update only the branch.master.remote and the branch.master.merge. Since I am merging with the 'origin' branch, I run:
neo$ git config branch.master.remote origin Then to get the merge to work correctly I set the following:
neo$ git config branch.master.merge refs/heads/master This tells git to merge the remote changes into the master branch. Once done a simple
neo$ git pull should do the trick.
