Command Description
git revert (or maybe something else...) HEAD file Revert local changes
git init Initialize a new repository in an empty directory.
git branch -d NAME Deletes named branch, usually after you have merged to master. -D to force.
git diff --name-only HEAD List filenames with uncommitted changes.
git diff HEAD@{1} Show cumulative changes between current (uncommitted) changes and one revision ago.
git diff HEAD@{3} HEAD@{2} Show changes from 2 commits ago.
git mergetool Interactive merge after getting conflicts.
gitk Visual view of branches.
g5 newcl The good stuff.
git5 patch CL Applies CL as patch to current branch.
git5 revert -a HEAD Completely fucked up your branch? Maybe this will help.

IMPORTANT: When you drop a new file into your repository, be sure to add and commit it to the active branch -- otherwise its just "sitting" in there and, when you switch branches, it'll continue to sit... Possibly screwing you up.

You want to keep your master in sync with the external tree.

Before starting work, create a new branch with "git checkout -b fixname".

You do your work on branches, committing freely.

When you're happy, create a new CL.

Before submitting the CL:

  • switch to master and synch with external tree.
  • switch to your branch and "git merge master."
  • test to make sure everything still works.
  • submit to external tree from branch.
  • switch back to master and sync from external tree to get updates.
  • "git branch -d fixbranch" to delete the branch -- hopefully it won't ask you to merge.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>