OpenHatch git workflow: Difference between revisions
imported>Paulproteus m (moved Openhatch git workflow to OpenHatch git workflow: Capitalize OpenHatch) |
imported>Jacquiesue m (→Resources) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 8: | Line 8: | ||
= Committing a patch = |
= Committing a patch = |
||
#After you have already retreived your respository of code |
#After you have already retreived your respository of code and made some changes, now you need to submit your changes for review to OpenHatch. |
||
##<code>git status</code> |
##<code>$ git status</code> (make sure the right files are listed here) |
||
##<code>git add <file(s)></code> |
##<code>$ git add <file(s)></code> |
||
##<code>git commit -m "Short message explaining your fix"</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 |
##<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. |
|||
⚫ | |||
##<code>git |
##<code>$ git format-patch origin/master</code> |
||
⚫ | |||
##<code>gitk</code> |
|||
##<code> |
##<code>$ git fetch</code> |
||
##<code>git |
##<code>$ git rebase origin/master</code> |
||
⚫ | |||
###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 = |
= Other useful commands = |
||
Line 29: | Line 38: | ||
= Resources = |
= Resources = |
||
* http:// |
* http://gitref.org/ |
||
* http://git-scm.com/documentation |
|||
= See also = |
= See also = |
||
Line 35: | Line 45: | ||
* [[How we handle patches]] |
* [[How we handle patches]] |
||
[[Category:Hacking_OpenHatch]] |
[[Category:Hacking_OpenHatch]] |
||
[[Category:Git_OpenHatch]] |
Latest revision as of 01:22, 22 October 2012
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.
$ git clone git://github.com/openhatch/oh-mainline.git
Committing a patch
- After you have already retreived your respository of code and made some changes, now you need to submit your changes for review to OpenHatch.
$ git status
(make sure the right files are listed here)$ git add <file(s)>
$ git commit -m "Short message explaining your fix"
- Note: If you want to submit everything listed in 'Unstaged changes' in
git status
, you can just do$ git commit -a -m "Short message explaining your fix"
, and skip the previous two steps.
- Note: If you want to submit everything listed in 'Unstaged changes' in
$ git log -p
(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.
$ git format-patch origin/master
- Now fetch any updates that may have occurred since you last did a
git clone
or agit fetch
$ git fetch
$ git rebase origin/master
$ git log
- 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 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