Posts Tagged ‘git’

man git

Wednesday, October 8th, 2014
# clone from github
git clone git@github.com:<user>/<repo_name>
# put any repo and link it somewhere else
# after: git init 
#    or: git clone <original_url>

# if you want to keep the original remote
git remote rename origin production

# add remote to where you want to push
git remote add origin <url_to_repo>

git push origin master # push ;) 
# use this to set the remote as "upstream",
# so you don't have to specify next time
git push -u origin master
# or this (for current branch)
git branch -u origin/master

# will add/stage current dir for next commit
git add .

# revert uncommited changes (no way back!)
git checkout <file>

 # will unadd (while keeping the changes!)
git reset HEAD <file>

# see diff for staged file (i.e. after git add)
git diff --staged <path/to/file>

# will let you specify what to commit
git add -p file