GitHub Upload Code Summary

Source: Internet
Author: User
Tags svn version control system git commands

What is the difference between git and svn? (This is part of the official argument)

SVN is a centralized version control system, the repository is centrally placed on the central server, centralized version control system must be networked to work. Sun up must be present before the code is submitted, or someone else's code might be flushed out.

Git is a distributed version control system that builds its own branch development directly locally, reducing unnecessary conflicts.

git commands (these commands are the ones I use more in my work)

git clone + git address//clone code to local

git check out master//Pull Skeleton Latest code

Git pull//get the latest code

git checkout-b dev//Create branch Dev

Submit Code

git add->git commit-m "Modify point description"->git push

Merging branches

git pull//Merge

Git fetch//does not merge

When pulling, you need to save the local changes:

Stash Save->pull->stash Pop

Discard Local Modifications: revert->pull

git diff//view changes to tracked files

Git status//View all modified files in the workspace

If you want to see a more comprehensive command , you can refer to: http://www.cnblogs.com/vman/articles/Git_cmds.html

Self summary of the four Git code steps (general code, I use the client, the client feels that four is enough)

Commit->fetch->rebase->push

Explanation: Commit: Upload your locally modified files to the local code base first;

Fetch: Pulls up the latest code on the library, but does not overwrite the local;

Rebase: Compare the code on the local library with the differences on the library, conflict resolution conflict;

Push: no conflict, upload directly to the remote repository.

GitHub Upload Code 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.