armno / blog

my hugo blog at armno.in.th
https://armno.in.th
4 stars 3 forks source link

git commands i use often #107

Closed armno closed 5 years ago

armno commented 5 years ago

WIP: https://github.com/armno/blog/tree/post/git-commands

$ git status

$ git diff [--staged]

$ git add .
$ git add :/

$ git reset

$ git commit
$ git commit --amend

$ git push origin HEAD
$ git push -u origin master

$ git pull
$ git fetch
$ git merge

$ git log -p

$ git checkout .
$ git checkout -
$ git checkout <commit hash>
$ git checkout -b feature/x origin/feature/x

$ git reset

$ git clean -df

$ git stash [list|pop]

$ git remote -v

$ git branch [-D]

# alias
$ git undo
$ git ldm

# finally
$ git <command> --help

and other commands

armno commented 5 years ago

$ git stash and friends

armno commented 5 years ago

$ git commit --amend

armno commented 5 years ago

using .gitattributes

armno commented 5 years ago

$ git checkout -

$ git push -u origin master

$ git reset --

armno commented 5 years ago

$ git remote -v $ git branch -a, -d, -D