1. Git fetch--prune cleans up local branches that are not remote
2. Git branch-d branchname Delete local branch
3. Git branch |grep ' branchname ' |xargs git branch-d bulk delete locally matched branchname git branch
4. Git checkout--File Undo Workspace Modification
5. git config core. ignorecase false to make git sensitive to file capitalization
6. Git error "bad index file SHA1 signature fatal:index file corrupt"
Solution: Remove the. Git/index, execute the git reset command
7. Git Reset--hard HEAD undo the merge without commit, or discard the workspace changes
git reset--hard commit-id rollback to Commit-id
8. Git reset HEAD <file> revoke files from staging area
9. Git log View commit record
Ten. Git reflog View all operational records
git push origin:branch-name Delete remote Branch
git push origin-u branch-name push the local branch to the remote and establish the connection
git remote-v view Remote warehouse address
14. Set user name and mailbox: Git config--global username ' name ', git config--global email ' [Email protected] '
15. Generate RSA in native, public key: Ssh-keygen-t rsa-c "[Email protected] '
16. Change the push mode, git config--global push.default simple or git config--global push.default matching
17. View Commit log: git log--oneline--graph-author= ' AuthorName '
18. View the commit log for a file: git log-p filename, git log-p View all submitted detailed file modifications
19. View a few lines of a file commit log: Git log-l 1,10:filename
20. To view a file in the workspace changes and staging area comparison: git diff filename
21. See the difference between staging area and last commit: git diff-cached filename
22. Delete Remote branch: git push origin:remote-branch
23. Compare the file differences between the current branch and another branch: Git diff branch-name FileName
24. View a file on another branch: Git show branch-name:filename
25. Merge one commit of another branch: Git cherry-pick commitid
26. Modify the latest submission description: Git commit--amend-m ' commit description '
27. Show Workspace root git rev-parse--git-dir
28. Relative to the workspace root directory: Git rev-parse--show-prefix
29. Show the current directory The root of the back to the workspace depth: git rev-parse--show-cdup
30. Edit git config file: project configuration git config-e global configuration git config-e--global, system configuration git config-e--system
31. Get configuration entry: Git config core.ignorecase, setting config: git config core.ignorecase false
32. Create repository: git init or git init dirname (Create workspace and build repository in this directory)
33. Set alias: Git config--global alias.st status, git conifg--global alias.ci commit
git use notes