Actual workflow
Master the Git workflow (1)-basic git operations
Master the Git workflow (2) - git branch management
Master the Git workflow (3)--git workflow
1. Create a warehouse
What does the gitingnore file do? When we are developing and running a file ending with .py, we often generate a file called *.pyc, which is useless for the project, and we don’t want git to manage these files. Add gitinnore when creating the warehouse to let it ignore these files.
2. Add SSH account
The directories of these two files are under .ssh/. After generating these two files, you need to add the key to ssh:
$ ssh-agent bash
$ ssh-add ~/.ssh/id_rsa
At this point, use the ssh -T [email protected] command to test:
If a "Host Key Verification Failed" error message appears, you can solve it by adding the know_hosts file: ssh-keyscan -H github.com >> ~/.ssh/known_hosts
After the solution is completed, test through the ssh -T [email protected] command, and it is successful
3. Clone the project
4. Upload branch
After cloning, the next step is to develop on your local computer.
Origin means the remote branch;
V. Tracking remote
After the local branch tracks a remote branch, if the submission of the local branch is inconsistent with the submission of the remote branch, a prompt will be given.
After the local branch tracks the remote branch and push the local branch to the remote branch, you can just use git push to push.
6. Pull code from remote branch
Seven. Work git use stream
There are usually two branches in the project, one is the master and the other is the dev branch.
The master branch is to save the released project code for users, and the Dev branch is to save the code in the development process.