pragmatic git workflow

Post on 13-Jan-2015

454 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

How to leverage git branches for clean and readable commit history.

TRANSCRIPT

Pimp my GitPragmatic Git workflow

Pulling the right way

Building a house

Multiple teams

One team builds the roof

Another seeds grass on the yard

Conflictless cooperation

Oh, really?

git pull

Git problem #721

“pull” does merge by default (rebase is an option)

Merging smarter

git pull --rebase

Merge

Rebase

After rebase

Commandment

Thou shalt pull with --rebase option.

Merging even smarter

$ sudo gem install git-up

Building a house

My workflow

Create a private branch

and do some work.

In the meantime

Someone else started working on the project

Risk of conflict

Rebase before merge

On feature branch, rebase with master branch

git rebase master

Resolve conflict

Resolve conflict on your local branch

git add .

git rebase --continue

Merge with squash

git checkout master

git merge feature --squash

git commit

Why?

Clean history

Each work item == one commit

Do not trash log with checkpoint commits

Conflicts resolved early

Missing (unnecessary) granularity

top related