Skip to content

Instantly share code, notes, and snippets.

@jamiew
Forked from caseypugh/easy-git.rdoc
Created August 13, 2012 04:36
Show Gist options
  • Save jamiew/3337005 to your computer and use it in GitHub Desktop.
Save jamiew/3337005 to your computer and use it in GitHub Desktop.
GIT MADE EASY

Checkout new repo

git clone git@github.com:vhx/watchlater

go into your vhx folder

cd ~/dev/vhx

Checks current status of modified files

git status

Shows you all the current modifications

git diff

Add a single file

git add path/to/my/file.css

Add a folder (this will add all files inside of it)

git add path/to/my/folderofshit

Selective adding of files using wildecard (*)

git add path/to/my/folder/st*.css

Commit your added files:

git commit -m "These are my changes"

Reset your changes on a single file

git checkout path/to/file.css

Reset ALL uncommited changes, going back to your latest local commit (HEAD):

git reset --hard HEAD

Reset ALL changes and commits to the latest pushed code (origin/master). Discards all commits you have not pushed.

Push all your changes to the server

push # using git-friendly
git push origin master # the normal git way

Sync with the server

pull # using git-friendly
git pull origin master # the normal git way

Change branches (master is the root/main branch)

branch mybranch # using git-friendly

OR

git branch mybranch
git checkout mybranch

OR

git checkout -b mybranch

See list of branches

branch # using git-friendly
git branch -a # normal git way
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment