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