git command-line command summary

Source: Internet
Author: User
Tags tagname

Git init
git Add File
git Add.
git commit-m "notes"
git log
Git reflog
git status
git diff (Git diff HEAD--file)
git reset--hard head~1 fallback last Commit
git reset--hard Commitid fallback to a commit
git checkout--file Discard workspace Modifications
Git reset HEAD file staging area fallback workspace
git rm file Delete files

Git Branch View branches
git branch dev Create Dev Branch
git checkout dev switch to Dev branch
git checkout-b dev Create and switch to Dev branch
git merge dev merges the Dev branch to the current branch
git branch-d Dev Delete branch
git branch-d Dev forcibly deletes a branch that has not been merged
git log--graph--pretty=oneline--abbrev-commit Branch Merge diagram
Git merge--no-ff-m "merge with--no-ff" dev merge dev branch with log

Git Stash Workspace Staging
Git Stash list Staging lists
git stash apply [email protected]{0} recovery workspace staging [email protected]{0} without deleting
git stash drop [email protected]{0} Delete workspace staging [email protected]{0}
git stash pop [email protected]{0} Recover and delete

Git remote repository
git remote-v Remote Library details
git checkout-b branch-name origin/branch-name local branch for creating and remote branch
Git branch--set-upstream branch-name Origin/branch-name Establish Association of local and remote branches

git tag <name> Create a new tag, default to head, or you can specify a commit ID
Git tag-a <tagname>-M "Blablabla ..." Label information can be specified
Git tag-s <tagname>-M "Blablabla ..." can be signed with PGP tag
git tag View all tags
Git push origin <tagname> can push a local tag
Git push origin--tags can push all the local tags that have not been pushed
Git tag-d <tagname> can delete a local tag
git push origin:refs/tags/<tagname> can delete a remote tag.

Summary of the Liaoche teacher's git tutorial, with the tutorial address Http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/

It's very good.

git command-line command summary

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.