Git code submission process and code submission conflict resolution:

  1. Find the warehouse address git clone http url and clone it locally
  2. npm install or yarn install to install related dependencies
  3. git checkout -b branch name creates a branch and switches to the branch (git checkout branch name switches to the specified branch)
  4. After modifying the relevant code, git add . Submit to the staging area
  5.  git commit -m "Remarks" commits to the local warehouse
  6. git push (origin/master) push to remote 
  7. The first push will prompt: "The current branch xxx has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin xxx" This is because the current branch does not have any upstream branch. If the association causes the submission to fail, just enter git push --set-upstream origin xxx
  8. Generally, git pull is performed before pushing. When git pull is performed, it is equivalent to pulling the remote warehouse code to the local workspace. When there is a conflict in the code, git will merge the content that can be merged with the content that cannot be merged to prompt the developer to correct it. Modify the content of the prompt and then again (add——commit——push)
  9. git pull is equivalent to git fetch origin/master (pull the branch from the remote to the local) and git merge origin/master to merge into the remote branch.
  10. Refer to the git push code submission error prompt [rejected]"error: failed to push some refs to {project url}" - Situ Yunran- Blog Park

Guess you like

Origin blog.csdn.net/r8577/article/details/127552427
Recommended