Common git operations

Source: Internet
Author: User
Tags git pull remote branch

Git pull remote branch and merge to local

git fetch pull remote branch does not do merge ignore file. Gitignore Add file git Add. Commit all modifications git commit-am ' memo info ' push local branch to warehouse GIT push origin master:master Delete remote Branch git push origin:test from the remote code to the local repository Git pull Origin master:master create a new branch based on the branch git checkout-b dev2 master switch branch git checkout dev2 Delete Except local branch git branch-d dev2 Force Delete local branch git branch-d dev2 View all branches git branch-a view all remote branches git branch-r Delete local presence remote nonexistent git branch-d-R Origin/test pull the remote branch to local GIT fetch Origin dev pull the remote and merge local Git pulls Origin dev there may be conflicting staging modification records git stash (can save add file add warehouse together) view staging record Git Stash list Delete staged Git stash drop staging number clear staged git stash clear pop-up staged git stash pop undo uncommitted modify Git checkout filename undo committed modify Git Reset–h Ard|–soft version undo push modified Git revert-n commitid (resolve conflict, commit, push)

Common git operations

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.