HOWTO: Common Git Operations ============================ Initialize a repo ----------------- Clone existing repo ------------------- $ git clone git://code.cactuswax.net/archweb.git/ archweb_pub Make desired changes and commit all with: $ git commit -a or to commit only certain files: $ git commit Create patchset --------------- Do a fetch first, and a rebase to make sure any updates are incorporated: $ git fetch origin $ git rebase origin If a conflict is found: cat the file in question and look for <<<< >>>> and =====. Remove these lines and any content between. Then do: $ git add to update the meta so git will know the file is fixed. Then do: $ git rebase --continue and git should finish the rebase. Once completed, view the history of changes: $ git log To create a patch, do: $ git format-patch or to dump the patch in ~/ do: $ git format-patch -s --attach -o /home/thayer origin Email the resulting patch. Using git pull to update local copy when upstream changes are available ----------------------------------------------------------------------- $ git fetch $ git checkout -b temp origin/archweb_pub $ git branch -D archweb_pub $ git checkout -b archweb_pub origin/archweb_pub $ git branch -D temp