Git for impatients

Clone a project:
git clone

Commit a change
git commit -am "comment"

Push (to remote) a change
git push

Retrieve changes for the current branch (it’s actually more but you’re impatient!)
git pull --rebase

Create a branch
git branch branch_name

Switch to a branch
git checkout branch_name

Switch and Branch in one go
git checkout -b new_branch_name

Push local branch to remote (after you can use the normal push above)
git push -u origin branch_name

Merge branch into master

git checkout master
git merge branch_name

Remove local reference to deleted branches

git remote prune origin

Remove file from git source control without deleting
git rm --cached file_name

Won’t add more coz it’s just for impatient, if you need more..

git --help


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: