OpenHatch git workflow: Difference between revisions

m
imported>Jacquiesue
No edit summary
imported>Jacquiesue
 
(6 intermediate revisions by 3 users not shown)
Line 1:
Some guidelines on how to use git when working on openhatchOpenHatch
 
= Getting a new clone of openhatchOpenHatch =
Only need to do this once. Or if you want to start form scratch.
It is also good (okay) to remove your <code>oh-mainline</code> directory
and start over if you aren't sure the state of your openhatchOpenHatch repository.
#<code>$ git clone git://github.com/openhatch/oh-mainline.git</code>
 
= Committing a patch =
#After you have already retreived your respository of code. And you haveand made some changes, now you need to submit your patch (that will contain your changes) for review to openhatchOpenHatch.
##<code>$ git status</code> (make sure the right files are listed here)
##<code>$ git add <file(s)></code>
##<code>$ git commit -m "Short message explaining your fix"</code>
###Note: If you want to submit everything listed in 'Unstaged changes' in <code>git status</code>, you can just do <code>$ git commit -a -m "Short message explaining your fix"</code>, and skip the previous two steps.
##<code>git log -p</code> (opens in less editor)
##<code>$ git format-patchlog origin/master-p</code> (opens in less editor)
###Note: This is just to help you verify that your commit took effect correctly. If it didn't, there were likely errors in one or more of the above steps.
#Now git any updates that may have occurred since you last did a <code>git clone</code> or a <code>git fetch</code>
##<code>$ git fetchformat-patch origin/master</code>
#Now gitfetch any updates that may have occurred since you last did a <code>git clone</code> or a <code>git fetch</code>
##<code>gitk</code>
##<code>git$ rebasegit origin/masterfetch</code>
##<code>$ git logrebase origin/master</code>
##<code>$ git log -p</code> (opens in less editor)
###Note: This is just to help you verify that your commit took effect correctly. If it didn't, there were likely errors in one or more of the above steps.
 
= Submitting a patch =
Find your patch file that has been generated from the <code>git format-patch</code> command. In your current directory you can run
<code>ls -lrt</code> which will list your files in time-sort order. Listing the
newest modified files at the bottom. Look for the file similar to
<code>0002-Updated-the-default-case-for-people-search-AllTagsQu.patch</code>. 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.
 
Note: The <code>git log</code> and <code>gitk</code> 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
 
= Other useful commands =
Line 29 ⟶ 38:
 
= Resources =
* http://helpgitref.github.com/git-cheat-sheetsorg/
* http://git-scm.com/documentation
 
= See also =
* [[How to generate patches with git format-patch]]
* [[How we handle patches]]
 
[[Category:Hacking_OpenHatch]]
[[Category:Git_OpenHatch]]
Anonymous user