Skip to content

Latest commit

 

History

History
42 lines (31 loc) · 1.72 KB

git_branching_guide.md

File metadata and controls

42 lines (31 loc) · 1.72 KB

Branching guide

Common options

Basic workflow with branches, see 2

Basics

git branch - list of current local branches in repository git branch - create new branch called (without checkout) git checkout -b - create new branch called with checkout git branch -d - delete local branch (safe, prevents delete without unmerged changes) git branch -D - delete local branch (force) git branch -m - rename current branch to new branch name git branch -a - list all branches (local/remote together)

Advanced techniques

git remote add git push - two commands create remote repository from local git branch <branch_name> <commit_sha> - create new branch from specific git commitID git checkout -b <branch_name> <tag_name> - create new branch from tag

Namimg strategy

Some suggestions for naming your feature branches:

users/username/description users/username/workitem bugfix/description feature/feature-name feature/feature-area/feature-name hotfix/description

see link 1

Flow

  • create local branch, git branch <new-branch-name>

Sources

  1. https://learn.microsoft.com/en-us/azure/devops/repos/git/git-branching-guidance?view=azure-devops#name-your-feature-branches-by-convention
  2. https://www.atlassian.com/git/tutorials/using-branches