我有我要在Git中保存本地工作區,這wasnt本地git倉庫,直到now.Just工作區 我在git的慶典檢查在本地工作區到新的git倉庫
CD myworkspace
做的步驟git init
git add。
git的承諾-m 「第一承諾」
git的遠程添加原產https://github.com/username/eclipse.git
混帳推起源主
通過這樣做,我得到一個錯誤
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/username/eclipse.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
然後我做這個
git pull origin master
warning: no common commits
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (4/4), done.
From https://github.com/koushikpaul1/eclipse
* branch master -> FETCH_HEAD
* [new branch] master -> origin/master
fatal: refusing to merge unrelated histories
任何人都可以幫我這個錯誤,
注:我創造了我的git回購作爲一個Java之一,所以目前它只有 的.gitignore和README.md
,而谷歌上搜索,我發現步驟檢查在現有工作區到Git的是
$ CD MY_PROJECT
$ git的初始化
$ git的添加*
$ git的承諾-m 「第一承諾」
$ git的遠程添加原產https://github.com/yourname/my_project.git
$ git的拉原點主
$混帳推起源主
但我被困在第二個最後一步。
非常感謝!
您是否嘗試從網址或來源拉取? – Li357
打開git配置,並檢查來源實際上是您使用的網址... –