Using Magit

Basics

Key

Meaning

C-x g

open Magit interface

C-g

abort current operation

s

stage file

c c

commit staged changes

C-c C-c

finish editing commit message

P u

push to origin

F u

pull from origin

f u

fetch from origin

Create a New Branch

Key

Meaning

b c ENT

create a new branch at current branch

P u

push to origin

Synchronize Current Branch with Origin

Key

Meaning

M a upstream ENT

add remote “upstream”

f u

fetch changes from all sites

r e upstream/master ENT

rebase onto upstream branch

p - F u

force-push to origin

Squash Commits

Key

Meaning

r - i u

interactive rebase

c

the commit to keep

p

the commits to drop

p - F u

force-push to origin