Created
December 4, 2018 16:45
-
-
Save xbalaji/54abccdc888977eaddcbf540ae53df26 to your computer and use it in GitHub Desktop.
git branch and cheat sheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd <basedir> | |
git clone ssh://git@<your git repo>:7999/fleet/fleet.git | |
cd <basedir>/fleet | |
git checkout -b xbtask01 | |
... make changes ... | |
cd <basedir>/fleet | |
git status | |
git commit -am "fixing issue, task01" | |
git push origin xbtask01 | |
... from web: create pull request, approve, merge ... | |
cd <basedir>/fleet | |
git checkout master | |
git branch # look for the branch | |
git branch -D xbtask01 | |
git push origin :xbtask01 # deletes the branch in repository | |
git branch # the branch is now deleted locally | |
cd <basedir>/fleet | |
# git best practices | |
# Best practices | |
# 1. Don't commit anything to master directly | |
# 2. Check configuration access for repository - read without account? read/write ? - config. steps | |
# 3. Create a project branch - steps? | |
# 4. Create a branch for every task - using JIRA identifier | |
# 5. Commit your changes to your personal branch | |
# 6. Do a pull request to the master branch. Pull request will generate a review request - configuration steps | |
# 7. Make sure minimum approvers for committing to master branch is configured in repository - configuration steps | |
# 8. Optionally you can also set mandatory reviewers for a pull request approval - configuration steps |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment