Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

7. Push the change back to Apache. Pick one of the following:

Code Block
git push

Committer Workflow using Git Branches

If you are working on a sizable set of code, for instance, implementing a significant feature, then it is recommended to use a Git remote branch. This will not only help backup your code but also ensure the master branch is never in an unstable state. Also, using a branch will make for easy code reviews and collaboration. 

The workflow for creating a remote branch and using it is the following (presuming that you have done a git clone and are in the master branch) :

  1. Create a local branch from master:
Code Block
git checkout -b KNOX-nnn

2. Push the local branch remote and setup remote tracking

Code Block
git push -u origin KNOX-nnn

 

3. Implement the feature and commit and push as desired.

Code Block
git commit -am "<short message about commit>"
git push

 

4. To update the branch from master at any time

Code Block
git pull --rebase origin master

 

5. To merge the branch back into master, first switch to the master branch and then merge.

Code Block
git checkout master
git merge KNOX-nnn
git push

 

6. After all code has been merged and the branch is no longer needed, it can be deleted remotely with:

Code Block
git push origin :KNOX-nnn

To delete the branch locally

Code Block
git branch -d KNOX-nnn

 

Github Workflow

Apache doesn't seem to provide a place to stash your work-in-progress branches or provide some of the nice social features github has. This can be a problem for larger features. Here are instructions for using github as a place to stash your work in progress changes.

...