Typically code version control step is:
- In the code version control platform to create a new warehouse
clone
A remote repository to localStart coding, followed by a series of
add
,commit
,push
My steps are:
- In remote code version management platform to create a new warehouse
- Create a new project in the local
- By
git remote add
adding a remote repository - Then
add
,commit
,push
butcommit
when on the error:
error: failed to push some refs to ....
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
This shows that the two warehouses at this time and did not associate the two warehouse code is not synchronized.
Follow the prompts using the git pull
pull and merge remote code and error as follows:
refusing to merge unrelated histories
Means that the history of two unrelated warehouse.
Final Solution:
Allow history irrelevant:
git pull origin master --allow-unrelated-histories
Then again push
.