Read more

Basic git commands

Deleted user #6
August 25, 2010Software engineer

This is for people recovering from Subversion.

Get an existing from the server for the first time

Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

git clone git@example.com:repositoryname

See what's changed

git status

Check in locally

git commit -m "good description"

Push local commits to the server

git push

Get and merge updates from the server

git pull

Stage a file for the next local commit

git add file

Stage all files for the next local commit

git add .

Create a new local branch and check it out

git checkout -b branchname

Switch to a local branch

git checkout branchname

Switch to the previous branch

git checkout -

Overview of local branches

git branch

Delete a local branch

git branch -d branchname

Insert changes on the server before your local changes

git pull --rebase

Temporarily discard local changes

git stash

Re-apply stashed away changes

git stash apply

Re-apply stashed away changes an delete them from stack

git stash pop

Find out who wrote something

git blame filename

Restore a deleted file (notice the space before and after the double dash)

git checkout -- filename

Posted to makandra dev (2010-08-25 14:06)