The Tower app website has a good description of git fetch vs pull. “You can never fetch often enough” is a helpful phrase.
This article titled, Little things I like to do with git, has a fun series of git commands.
While I’m in the Mary Rose Cook neighborhood, she also wrote this excellent Git tutorial.
This SO tip on how to automatically remove/delete all files from a Git repository that you have already deleted on disk is a real timesaver. Of course it’s a wee bit dangerous (and probably won’t work on Windows), but that’s part of its charm.
If you attempt to do a normal
git push origin master after adding a tag, you’ll get an “Everything up-to-date” message from Git. In short, this is because you have to push a tag to the origin just like you push a branch.
In my case I just created a tag named
v0.1, so I pushed it like this:
git push origin v0.1
The output from the
git push command looks like this:
Yesterday I needed to be able to specify a port with a
git clone command, because the git server runs ssh on a non-standard port. In short, the solution was to put this text in my ~/.ssh/config file:
Git rm FAQ: How do I tell Git not to track a file (or files) any more? That is, I want to remove the file from the Git repo?
While working on an application named "sarah" yesterday (named for the house known as "SARAH" in the tv series Eureka), I accidentally checked some files into Git that I didn't mean to. These were were primarily binary files in my project's "bin" and "target" directories.
Summary: This is a Git cheat sheet (Git command summary) I've created, featuring many Git command examples.
As I've begun to set up my own private Git hosting repository (see Private Git hosting services, and My A2 Hosting Git repository using SSH), it's time to cram all these Git commands back into my head again.
git status FAQ: When I issue the "git status" command, I see the following "Your branch is ahead or origin/master ..." git message:
# On branch master # Your branch is ahead of 'origin/master' by 5 commits. # nothing to commit (working directory clean)
What does this "Your branch is ahead of 'origin/master' by X commits" message mean? I keep committing my changes with "git commit", so this message seems to be in error.