version control cheat sheet for git workflows - microsoft - git... · version control cheat sheet...
TRANSCRIPT
Version Control Cheat Sheet for Git Workflows
Visual Studio ALM Rangers Solutions – http://aka.ms/vsarsolutions
Commandsgit command git command line tool with a variety of commands. help
Type git -help on the command line for a complete list
of commands and arguments.
branching• branch [name] creates branch called name based on HEAD
• merge two branches
Making Changes – centralised workflow
Local repo
Git
Origin
File
Rem
ote
Clie
nt
❶ Pull
❷ Modify
❸ Commit
❹ Push
C D
A B
Topic 1
Main
Origin master
Topic Branch
Topic branch using the DAG diagramCentralised workflow using the Directed Acyclic Graph (DAG) diagram
A B Main
Origin master
C
Local repo
V3.2
Local repo
Git
Origin
Rem
ote
Clie
nt
Reviewing Changes – with pull requests
Topic
Branch
❶ Pull
❷ Create
Topic branch ❸ Modify
❹ Publish topic branch + commit
❼ Reviewers view the pull
request, reviews code,
comments + approves
❽ Complete merge
❺ Push
❻ Create pull request
File
everyday• commit (verb) all the staged local changes
• pull the latest changes from origin and merge into working
copies
• push commits changes to origin