Common git commands

Source: Internet
Author: User

1

git init turns the current directory into a manageable git repository, creating a hidden. git file.   git add xx adds xx files to the staging area.   Git commit–m "XX" commits a file –m followed by a comment. Git Status View warehouse status gitdiffxx view xx file modified those contents git log view history git Reset–hard HEAD^ or git reset–hard head~Fallback to previous version (if you want to fallback to 100 versions, use git reset–hard HEAD~ - )   Catxx view xx file content git reflog View history version number ID git checkout-xx undo all the changes to the xx file in the workspace. GitRMxx Delete xx file git Remote add origin https://Github.com/tugenhua0707/testgit associating a remote librarygit Push–u (the first time to use-u do not need later) Origin master pushes the current master branch to the remote repository git clone https://github.com/tugenhua0707/testgit cloning from a remote librarygit checkout–b Dev Branch and switch to the dev branch on Git branch view current all branches git checkout master switch back to master branch git merge dev in the current minute Support on Merge dev branch git branch–d dev remove dev branch git branch name create branch git stash hide current work and then resume work after resuming live git stash list view all hidden List of files git stash apply recover hidden files, but content does not remove git stash drop delete file git stash pop recover file also delete file git remote view remote library information git R Emote–v View details of remote libraries Git push origin master git pushes the master branch to the remote branch of the remote library

Links to git branch--set-upstream dev origin/dev #添加本地dev分支与远程origin/dev Branch

Common git commands

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.