Git Flow Guidelines
Branch in git flow:
Started Commands:
1- Inside your folder project you can start the git flow with the following command:
git flow init
Then use Enter key to adhere to a standard thought you can change the prefix name if you need it.
2. Add your remote repository:
git remote add origin https://host.domain/user/yourepository
3- By default you are left in the Develop branch, you can create a feature branch with the following command:
git flow feature start my-name-branch
4- Add and commit your changes then you can push the feature branch
git add
git commit -m 'my well write comment'
git flow feature publish my-name-branch
5- To finish your changes(features) use the following command:
git flow feature finish my-name-branch
Your feature branch will be deleted, but first will be merged into the develop branch.
Remember you had to push master and develop branch with the originals git commands:
git push origin master
git push origin develop
For more commands just visit these notes.
Advice: went thing don't work as we expected, we'll need to execute the raw git commands, for examples we may need to execute:
git merge release/0.0.1 --allow-unrelated-histories
Commands:
git flow / *(init) (feature/release/hotfix/bugfix)/(start/finish/publish/pull)/branch_name
Writing Commit Rules:
Rules for commit messages by Chris in his blog:
- Separate subject from body with a blank line
- Limit the subject line to 50 characters
- Capitalize the subject line
- Do not end the subject line with a period
- Use the imperative mood in the subject line
- Wrap the body at 72 characters
- Use the body to explain what and why vs. how
Useful git commands:
Reset just a folder: git checkout HEAD --
Reset a file to a previous commit:
git checkout c5f567~1 -- file1/to/restore
No comments:
Post a Comment