How Git and GitHub work

Source: Internet
Author: User

Git and GitHub

GitHub is the name of the server that manages the code remotely

Git Code management System

(Git is a system, so git has a few commands.)

git operation process

Start by creating a local repository to submit the code to GitHub (GitHub also has a warehouse).

1. Git init (build local repository)

Tip: You can use git status to query version management status at any time;

2. Add the file to the URN platform (stage) some translated into ' photos ', some translated into (cache);

3. How to join the URN table

git add< file name > (add the file to the urn table);

4. Add the files in the stage to the local library

git commit-m "Submit information (write it casually)";

5. Put the files from your local repository on GitHub

Connect to GitHub first (register on GitHub before connecting, and build a warehouse [Repository]repo)

Git remote Add name the content you copied

Push the local warehouse into GitHub's warehouse.

git push-u name Master//-u is actually remembering which warehouse you're pushing from.

After a while, the main staff leave, add new feature, fix bugs, need to get project code from github above git remote add name you copy the content

Pull the project to the local

Git Pull name Master

After modifying the code, use the above command to add to the stage

Git diff--staged look at the difference between the code you changed and the original code.

Core: The core of Git is that its branch is not a copy of the entire master, but the discovery

Which file to copy which file has changed. This is a lot more efficient than other version management systems.

How Git and GitHub work

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.