Reference links
Problem Description
- Pre-existing local warehouse and the new github repository association, and upload local warehouse.
- First, after a
init
+git remote add ..
a series of steps associated - If you choose the protocol when GitHub building a database, you need to pull, this time in no
git push -u ..
case of, such as the title may be an error
problem analysis
-
If you combine two different starting a warehouse submitted, the new
git
will find two warehouses may not be the same, in order to prevent developers upload error, then gave the following tipsfatal: refusing to merge unrelated histories
-
New on Github as a warehouse, wrote License, and then write a local warehouse for a long time to upload. Then find github repository and not a local joint
commit
so git not to submit, that is the wrongorigin
, if the developer is determined thatorigin
you can use--allow-unrelated-histories
to tell ourselves git -
Encountered a problem can not be submitted, which is generally the first pull use
git pull origin master
- Here is the origin warehouse
- master branch is required to upload
- Because two different warehouses, found git output
refusing to merge unrelated histories
can not pull content
-
Because they are two different projects, two different projects should merge, git you need to add a code, in
git pull
after this code is happening in git 2.9.2 version, the latest version needs to be added--allow-unrelated-histories
to tell git allow irrelevant history merge
problem solved
-
If the source is the origin, the branch is master, then write:
git pull origin master --allow-unrelated-histories
-
If you have set a default upload branch can use the code below
git pull --allow-unrelated-histories