The two libraries do not have a common ancestral history and cannot be simply merged. You need to think about which library you want to extract the submission records from and apply them to another library.
My suggestion is to clone the remote warehouse first, and then copy the local warehouse directly into it. Although this method is not very elegant, it can still solve the problem well. In addition, it is best not to add any files when initializing the remote warehouse, as this will make subsequent work more difficult.
If there is a conflict, you can
git fetch origin master
,然后处理冲突文件,处理完后add-commit-push
this set first.The two libraries do not have a common ancestral history and cannot be simply merged.
You need to think about which library you want to extract the submission records from and apply them to another library.
My suggestion is to clone the remote warehouse first, and then copy the local warehouse directly into it. Although this method is not very elegant, it can still solve the problem well. In addition, it is best not to add any files when initializing the remote warehouse, as this will make subsequent work more difficult.
First
git fetch
,git pull
will automatically merge, fetch will not, then resolve the code conflict and then mergeFirst pull an empty folder, then replace your existing files in push
You can submit local code first and then use git pull origin master, resolve conflicts and then git commit and then git push origin push