OpenHatch git workflow

From OpenHatch wiki
Revision as of 18:40, 24 March 2012 by imported>Jacquiesue
Jump to navigation Jump to search

Some guidelines on how to use git when working on OpenHatch

Getting a new clone of OpenHatch

Only need to do this once. Or if you want to start form scratch. It is also good (okay) to remove your oh-mainline directory and start over if you aren't sure the state of your OpenHatch repository.

  1. $ git clone git://github.com/openhatch/oh-mainline.git

Committing a patch

  1. After you have already retreived your respository of code. And you have made some changes, now you need to submit your patch (that will contain your changes) for review to OpenHatch.
    1. git status
    2. git add <file(s)>
    3. git commit -m "Short message explaining your fix"
    4. git log -p (opens in less editor)
    5. git format-patch origin/master
  2. Now git any updates that may have occurred since you last did a git clone or a git fetch
    1. git fetch
    2. gitk
    3. git rebase origin/master
    4. git log

Note: The git log and gitk commands aren't modifying your patch, these commands are run to track your changes, and see what state your patch is in, in comparison to the origin

Submitting a patch

Find your patch file that has been generated from the git format-patch command. In your current directory you can run ls -lrt which will list your files in time-sort order. Listing the newest modified files at the bottom. Look for the file similar to 0002-Updated-the-default-case-for-people-search-AllTagsQu.patch. This file or these files will need to be added to the bug tracker... if we are still doing this. The alternative is just using github, which some people are starting to look into.


Other useful commands

  • git rebase -i origin/master -- to combine patches into one. after which re-run format-patch command. notice "-i"
  • git diff -p
  • git rm
  • git -u

Resources

See also