Skip to content

Git

tutorials#

Best Chinese one so far I've seen Document

common command list#

from ruanyifeng (in Chinese)

errors:#

fatal: renaming 'MyProj/src/ts0621/foobar.c' failed: No such file or directory

git on nas#

For Win#

use PuTTy

For Mac#

use native terminal.app

Common#

frequently used commands:

1
2
3
4
5
6
7
8
9
ls -la
git
git init
git config —bool core.bare [true]
chown -R -v admin .
git remote add pnas ssh://admin@192.168.0.10/volume1/git/pobop
git remote add pnas.git ssh://admin@192.168.0.10/volume1/git/pobop/.git
git** push pnas.git master
git clone ssh://admin@192.168.0.10/volume1/git/pobop/.git

20200804 最后的问题是没解决 submodule 的问题。 以后再看看

20200809 Started git study 20200816 back to Git on NAS

TODO#

merge : git

study content#

20200809 following this book https://git-scm.com/book

note#

2.2#

  • the subdirectories, it's also possible to add have new .gitignore files, which is applied only to files under this subdirectory.
  • use VIM to edit git commit comments.
  • set core.editor to #VSCode https://stackoverflow.com/a/53602330
  • git rm does remove the file from the disk. Use git rm --cached to detach from git track.
  • Use git mv because I do think it cannot track moved things

2.3#

20200811 https://git-scm.com/book/en/v2/Git-Basics-Viewing-the-Commit-History

  • git log.
  • with format git log --pretty[=oneline/format :"..."]. format specifiers
  • detailed version git log --stat.
  • detailed version: git log -p [-NUM] : -p = --patch.

2.4#

20200815

  • git commit --amend
  • git reset HEAD
  • git checkout

It is not so necessary to do this 100% right, its not important. Time matters more.

English words#