Every time you build a new warehouse, there will always be such an error when you submit it. It’s really a headache
The steps of GIT submission are as follows:
1. Git init// initialize the warehouse
2. Git add. (file name)// add file to local warehouse
3. Git commit – M “first commit”// add file description information
4. Git remote add origin + Remote warehouse address// link the remote warehouse and create the main branch
5. Git push – U origin master// push the files of the local warehouse to the remote warehouse
The following error occurs after submission
to solve the above errors, you only need to use git pull origin master between 4 and 5
Correct procedure:
1. Git init// initialize the warehouse
2. Git add. (file name)// add file to local warehouse
3. Git commit – M “first commit”// add file description information
4. Git remote add origin + Remote warehouse address// link the remote warehouse and create the main branch
5. Git pull origin master// connect the changes of the local warehouse to the main branch of the remote warehouse
6. Git push – U origin master// push the files of the local warehouse to the remote warehouse
Reprint address: https://www.cnblogs.com/alex-415/p/6912294.html
Similar Posts:
- Git Pull Error: Please specify which branch you want to merge with.
- Git Push hint: Updates were rejected because the remote contains work that you do hint: not have …
- Git – Your branch and ‘origin/xxx’ have diverged
- How to Solve error: failed to push some refs to ‘xxxx’
- Git pull does not specify an error message for the branch
- Git | fatal: refusing to merge unrelated histories [How to Solve]
- [Solved] error: failed to push some refs to ‘xxxx’
- fatal:’origin’ does not appear to be a git repository fatal:Could not read from remote re…
- error: src refspec master does not match any [How to Solve]