Commands used in a GIT project

Source: Internet
Author: User

First, pull the latest content of the remote branch to its own branch and push it to its own remote branch

1 git Status View modify content
2 git Add. Commit changes to cache
3 git commit-m ' modify content ' to submit code to the repository and display the modified content
4 Git fetch origin develop G It pull sync Remote code
5 git rebase orgin/develop git sync Local code may generate conflict code in resolve conflict from Add start doing the following operation
6 git push orgin Develop-yongbo git will de Velop-yongbo branch push to remote corresponding remote branch

Second, merge your own code into the remote branch to get the latest code (two ways)

1.git Checkout develope Switch to the total branch
2.git Merge Origin/develop-yongbo merge your own branches and total totals
3. Conflict resolution
4.git Add. Add to Cache
5.git commit 




1.git checkout develope switch to the total branch
2.git cherrypick Develop-yongbo The commit number
3. Conflict resolution
4.git Add. Add to Cache
5.git Cherry_pick--continue 
6.git checkout Develop-yongbo switch to own branch
7.git Reset--hard Develop Forcing the merge to local develop code to override local Develop-yongbo branch
8.git push Origin develop-yongbo-f strongly push local develop-yongbo to remote branch

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.