Friday, September 18, 2015

More git commands

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

$git log --decorate=full
$git log --decorate=full --pretty=oneline

#If I made a hard reset to a previous commit (but I had already pushed last commit), then I have to make a forced push:

$git reset --hard a9355ba42f5418c
$git push origin HEAD --force  #Erases in the online server the last commit

No comments:

Post a Comment