Git Learning -- & gt; Introduction to other common commands

Source: Internet
Author: User

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

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.