In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the relevant knowledge of "what are the commonly used commands of Git and how to use them?" in the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
I. configuration operation
1. Global configuration git config-- global user.name 'your name'-- global user.email 'your mailbox' 2, current warehouse configuration git config-- local user.name 'your name' git config-- local user.email 'your mailbox 3, view global configuration git config-- global-- list4, view current warehouse configuration git config-- local-- list5, delete global configuration git config-- unset-- global configuration item 6, Delete the current warehouse configuration git config-unset-local configuration item 2, local operation 1, view the changes git status2, add all changes in the current directory and its subdirectories to the temporary storage area git add. 3, add all changes in the warehouse to the temporary storage area git add-A4, add the specified files to the temporary storage area git add file 1, file 2 file 35, compare all the differences between the workspace and the temporary storage area git diff6, Compare the differences between a file workspace and a staging area git diff files 7, compare all differences between a staging area and HEAD git diff-cached8, compare a file staging area and HEAD differences git diff-cached file 9, compare a file workspace and HEAD difference git diff HEAD file 10, create a commitgit commit11, restore the workspace specified file to a consistent git checkout file 1file 312, Restore the files specified in the staging area to be consistent with HEAD file 1 file 2 file 313, restore all files in the staging area and workspace to the same git reset-hard14 as HEAD, use difftool to compare the differences between any two commit submission 1 commit 215, see which files are not controlled by Git git ls-files-others16, save unprocessed changes to stash first, and continue previous work after temporary tasks are completed
Pop does not retain stash
Apply preserves stash
Git stash popgit stash apply18, view all stashgit stash list19, retrieve some stash change git stash pop stash@ {number n} 20, gracefully modify the last commitgit add. Git commit-- amend 3, branch operation 1, view current working branch and local branch git branch-v2, view local and remote branch git branch-av3, view remote branch git branch-rv4, switch to designated branch git checkout designated branch 5, create new branch git branch new branch based on current branch 6, create new branch git branch new branch based on specified branch 7, Create an id8 of a git branch new branch based on a commit, create and switch to the branch git checkout-b new branch 9, safely delete a local branch git branch-d to delete 10, forcibly delete a local branch git branch-D to delete 11, delete all local branches that have been merged into the master branch git branch-- merged master | grep-v'^\ *\ | master' | xargs-n 1 git branch-D12, Delete all local branch git remote prune orign13 where the remote origin no longer exists, merge the A branch into the current branch and create a commitgit merge A branch for merge 14, merge the A branch into the B branch and create the commitgit merge A branch B branch 15 for merge, rebase the current branch based on the B branch In order to merge the B branch into the current branch git rebase B branch 16, and rebase the A branch based on the B branch. In order to merge the B branch into the A branch git rebase B branch A branch 4, change history 1, each commit of the current branch displays git log-oneline2 on one line, the nearest n commitgit log-N3, the history git log-- oneline-- graph-- all4 of all branches is graphically displayed, all commitgit log files related to a file change 5, the commit corresponding to the last modification of each line of a file, and the author git blame file V, label operation 1, View the existing tag git tag2, create a new tag git tag v1.03, create a new tag git tag-a v1.0-m 'front-end canteen' 4, tag the specified commit with git tag v1.0 commitid5, push a local tag git push origin v1.06, push all unpushed local tags git push origin-tags7, delete a local tag git tag-d v1.08, delete a remote tag git push origin: refs/tags/ v1.06, Remote interaction 1, view all remote warehouse git remote-v2, add remote warehouse git remote add url3, delete remote warehouse git remote remove remote name 4, rename remote warehouse git remote rename old name new name 5, pull all remote branch and label changes to local git fetch remote6, pull remote branch changes to local And merge to the local branch git pull origin branch name 7, the local branch push to the remote git push origin branch name 8, delete the remote branch git push remote-- delete remote branch name git push remote: the remote branch name "what are the commands commonly used by Git and how to use" is introduced here, thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.