version control cheat sheet for git workflows - microsoft - git... · version control cheat sheet...

1
Version Control Cheat Sheet for Git Workflows Visual Studio ALM Rangers Solutions – http:// aka.ms/vsarsolutions Commands git 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 Remote Client Pull Modify Commit Push C D A B Topic 1 Main Origin master Topic Branch Topic branch using the DAG diagram Centralised workflow using the Directed Acyclic Graph (DAG) diagram A B Main Origin master C Local repo V3.2 Local repo Git Origin Remote Client 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

Upload: lekhanh

Post on 10-Feb-2018

229 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Version Control Cheat Sheet for Git Workflows - Microsoft - Git... · Version Control Cheat Sheet for Git Workflows Visual Studio ALM Rangers Solutions – Commands git command git

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