From Wiki
Revision as of 13:08, 1 September 2012 by Deoren (talk | contribs) (Rearranged content and added more links)
Jump to: navigation, search

My scratch notes on Git. Someday this page may actually be useful.


By answering these questions, I'll have a "cheat sheet" of useful tips/tricks to consult in the future.

How can you tell what branch or tag your working copy is on?

What if you are not seeing a tag that you know is available?

For example I had a copy of the MediaWiki 1.19.1 tag checked out [1] and even though a 1.19.2 tag was available I didn't see it when running git tag -l.

Running git fetch [2] seemed to do the trick:

remote: Counting objects: 96, done
remote: Finding sources: 100% (49/49)
remote: Getting sizes: 100% (58/58)
remote: Compressing objects: 100% (11/11)
remote: Total 49 (delta 30), reused 36 (delta 28)
Unpacking objects: 100% (49/49), done.
   49857f8..f25ee70  REL1_19    -> origin/REL1_19
   566852d..944e196  master     -> origin/master
 * [new tag]         1.19.2     -> 1.19.2

How do you switch from one tag to another?

Using our earlier example, let's switch from the 1.19.1 tag to the 1.19.2 tag.

git checkout 1.19.2

Previous HEAD position was d0c0aab... Merge "Bump $wgVersion and add release-notes for 1.19.1" into REL1_19
HEAD is now at f25ee70... Release notes and increment version


  1. I'm used to SVN, so this may be the wrong terminology
  2. What's the difference between fetch and pull?

git fetch - Manual Page

Unsorted links

These are just Git related links that I've dumped from my bookmarks folder. I'll go back and prune duplicates.