Git

Useful GIT & Nano Commands

November 05, 2013

Git commands

$ git branch
* master

$ git branch -a
* master
  origin/1-2-stable
  origin/2-0-stable
  origin/2-1-stable
  origin/2-2-stable
  origin/3-0-unstable
  origin/HEAD
  origin/master

$ git branch -r
  origin/1-2-stable
  origin/2-0-stable
  origin/2-1-stable
  origin/2-2-stable
  origin/3-0-unstable
  origin/HEAD
  origin/master

$ git remote show origin
* remote origin
  URL: git://github.com/rails/rails.git
  Remote branch merged with 'git pull' while on branch master
    master
  Tracked remote branches
    1-2-stable 2-0-stable 2-1-stable 2-2-stable 3-0-unstable master

$ git ls-remote --heads origin
5b3f7563ae1b4a7160fda7fe34240d40c5777dcd  refs/heads/1-2-stable
71926912a127da29530520d435c83c48778ac2b2  refs/heads/2-0-stable
2b158543247a150e8ec568becf360e7376f8ab84  refs/heads/2-1-stable
b0792a3e7be88e3060af19bab01cd3d26d347e4c  refs/heads/2-2-stable
d6b9f8410c990b3d68d1970f1461a1d385d098d7  refs/heads/3-0-unstable
f04346d8b999476113d5e5a30661e07899e3ff80  refs/heads/master

Set up Git repository
    git init
    git remote add origin https://github.com/pradeepkumargali/GenerateWord-OpenXML.git
    git push -f origin master

http://gitready.com/intermediate/2009/02/13/list-remote-branches.html

Rewrite History (use Caution)
#go back a commit and force push to repo

git reset --hard HEAD^
git push -f

Abort Merge
git merge --abort

A good list of Nano Editor Commands
http://www.howtogeek.com/howto/42980/

Cheat Sheet
https://na1.salesforce.com/help/pdfs/en/salesforce_git_developer_cheatsheet.pdf

Popular Posts

Twitter