Other common commands
Command
Git loggit log
Git log -- graph -- pretty = format: '% Cred % h % Creset-% C (yellow) % d % Creset % s % Cgreen (% cr) % C (bold blue) <% an> % Creset '-- abbrev-commit-
Google
$ git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen (%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --" skyman@SKYMAN-CF7E3587 ~/manual56 (master)
Shows the git lg effect:
Git config-global-
Globalgit bashgit lg
Command
Git diff xxx. mdgit diff
Command
Skyman @ SKYMAN-CF7E3587 ~ /Manual56/docs/Chapter_17 (master)
$
Git checkout xxx. mdgiffcheckoutGit checkout git checkout branchname
Command
Commitcommitgit rm
Git
$ Git rm 17.5.0.0.0.md
Rm 'docs/Chapter_17/17.5.0.0.md'
Deletion of directory 'cs/Chapter_17 'failed. shocould I try again? (Y/n) y
Deletion of directory 'cs/Chapter_17 'failed. shocould I try again? (Y/n) y
$ Git rm 17.5.0.0.0.md
Fatal: pathspec 'docs'/Chapter_17/17.5.0.0.0.md 'did not match any files
Ls
$ Ls 17.5.0.0.0.md
Ls: 17.5.0.0.0.md: No such file or directory
Command
Git rm-cached
-- Md
# On branch master
# Changes to be committed:
# (Use "git reset HEAD <file>..." to unstage)
#
# 17.5.0.0.md
#
#
/C/Documents and Settings /... /Chapter_17
Fatal: pathspec 'docs'/Chapter_17/17.5.0.0.0.md 'did not match any files
# On branch master
# Changes to be committed:
# (Use "git reset HEAD <file>..." to unstage)
#
# 17.5.0.0.md
#
[Master 711231b] Test change 10
1 file changed, 1 insertion (+), 1 deletion (-)
Counting objects: 9, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 383 bytes, done.
Total 5 (delta 3), reused 0 (delta 0)
To git@github.com: mchdbagh/manual56.git
3e96f90 .. 711231b master-> master
,
Git rm-cached xxx. mdCommand
Rm 'docs/Chapter_17/17.5.0.0.md'
# On branch master
# Changes to be committed:
# (Use "git reset HEAD <file>..." to unstage)
#
# 17.5.0.0.md
#
# Untracked files:
# (Use "git add <file>..." to include in what will be committed)
#
#
# On branch master
Nothing to commit (working directory clean)
Command
Git mv old-file-name new-fine-name
Github