2019年6月13日 星期四

git command line


最近需要在 Linux 終端機介面用 git 做版本控制。

用習慣了 windows 的 TortoiseGit 後,在 command line 反而不會用。Linux GUI 介面的 gitk、 git-gui等等也因為沒有 GUI 不能使用。

所以記錄一下command line 的命令:





  • Show Log (因為常用,可以寫成 script)
    •  git log --graph --pretty=oneline --abbrev-commit --all

  • Combine to one commit
    • git rebse --interactive HEAD~[N] 
    • git rebse -i HEAD~[N]

  • Amend Last Commit
    • git commit --amend

  • Show changes as unified diff
    • git diff HEAD^ HEAD

  • Show Last commit
    •  git show 
    •  git show --stat

沒有留言:

張貼留言