Menu

Git_CheatSheet

benblan

Create a local branch

git checkout -b <branch>

Push a branch to remote

git push -u origin <branch>

List branches

git branch     # Only list local branches
git branch -r  # only list remote branches
git branch -a  # list remote and local branches

Merge two branches

git switch <branch_receiving_merge>
git merge <feature_branch>

Delete branch

 git branch -d <branch_to_delete>  #local branch
 git push <remote_name> --delete <branch_to_delete>  #remote branch

Related

Wiki: Code Version Management
Wiki: Project Guidelines and Rules

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.