亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

github - Issues in git creating new project
曾經(jīng)蠟筆沒有小新
曾經(jīng)蠟筆沒有小新 2017-06-26 10:49:31
0
3
1006

There was a problem when creating the project, please see where I went wrong

  1. Writing code locally

  2. Create a new project on github and create readme.md directly using github

  3. git remote add origin git@github.com:xxx/xxx

  4. git push -u origin master
    Here, the error starts:

error: failed to push some refs to 'git@github.com:xxx'
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.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Then, git pull, another error was reported:

warning: no common commits
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (4/4), done.
From github.com:xxx
 + 8324a8d...8c9fdd4 master     -> origin/master  (forced update)
fatal: refusing to merge unrelated histories

What's wrong with this? What's the correct way to push a git project

曾經(jīng)蠟筆沒有小新
曾經(jīng)蠟筆沒有小新

reply all(3)
某草草
//第一步創(chuàng)建倉庫
//第二步 git clone 
//第三步 把你的項(xiàng)目代碼添加到clone出的文件夾里面
//第四步 push代碼到遠(yuǎn)端倉庫
阿神

The solution to your second error is as follows

[問題]fatal: refusing to merge unrelated histories

[解決]git pull origin master --allow-unrelated-histories

The correct way to use git is


1. git init

2.git add .

3.git commit -m '注釋'

4. git remote add origin httpsxxxx

5.git pull origin master

6. git push -u origin master

小葫蘆

Generally speaking, a warehouse can only have one initial submission point. If you create an initial submission through Github and create an initial submission locally, naturally an error will be reported when pushing locally.

If you choose to initialize the warehouse through a readme or the like when creating a project on Github, you should clone the remote warehouse locally instead of creating a new warehouse and binding the remote warehouse.

If you did not select the warehouse initialization option when you created the project on Github, you can create a new warehouse locally, bind it to the remote warehouse, and push the local initial submission to the remote warehouse.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template