Working on a feature branch (to easily share code)¶
- Table of contents
- Working on a feature branch (to easily share code)
(Adapted from the 35 ton tutorials by Karl Warburton)
- Setup your directory.
- Change to desired repository (e.g sbndcode).
- Make sure you have the latest develop branch.
git checkout develop git pull
- Make a new feature branch.
git flow feature start < BranchName >
- Do some coding.
- Check which files you have created/edited.
git status #Lists the changed/edited modules# git diff #Line by line description of what has been changed#
- Push to your feature branch if it's not ready for publishing (store it for later).
git add file_name.cc #Do this for all the files you want to add# git commit -m "about the commit"
- Publish the feature branch.
git flow feature publish < BranchName >
- When the project is finished you can now either delete the feature branch or merge it into develop.
- Delete feature branch locally.
git branch -d feature/< BranchName >
- Delete feature branch in origin.
git branch -dr origin/feature/< BranchName >
- Merge into develop.
git flow feature finish < BranchName >
Note that this merges the feature branch into your local
developbranch, deletes the local feature branch, but it does not push the changes into the remote
developbranch, nor it deletes the remote feature branch.
If merged you might want to push to develop.
git push origin develop