gitにpushする際に失敗してしまいます。
以下が試したことになります。なぜかpushが通りません、、、、
どなたかご教授願えませんでしょうか。。。。
git init, commitまで。
MacBook-Pro:site-master admin$ git init Reinitialized existing Git repository in /Users/admin/Desktop/site-master/.git/ MacBook-Pro:site-master adimn$ git add . MacBook-Pro:site-master admin$ git commit -m "Initialize repository" On branch master nothing to commit, working tree clean
originを削除し、再度originを登録。
MacBook-Pro:site-master admin$ git remote add origin https://github.com/admin/site.git fatal: remote origin already exists. MacBook-Pro:site-master admin$ git remote rm origin MacBook-Pro:site-master adimn$ git remote add origin git@github.com:admin/site.git
pushするも、(fetchが先とエラーが出現
MacBook-Pro:site-master admin$ git push -u origin master Enter passphrase for key '/Users/admin/.ssh/id_rsa': To github.com:admin/site.git ! [rejected] master -> master (fetch first) error: failed to push some refs to 'git@github.com:adimn/site.git' 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.
pullしてみる。そのあとpushするも(non-fast-forword)
MacBook-Pro:site-master admin$ git pull origin master Enter passphrase for key '/Users/admin/.ssh/id_rsa': warning: no common commits remote: Enumerating objects: 20, done. remote: Counting objects: 100% (20/20), done. remote: Compressing objects: 100% (20/20), done. remote: Total 423 (delta 10), reused 0 (delta 0), pack-reused 403 Receiving objects: 100% (423/423), 539.72 KiB | 132.00 KiB/s, done. Resolving deltas: 100% (133/133), done. From github.com:admin/site * branch master -> FETCH_HEAD * [new branch] master -> origin/master fatal: refusing to merge unrelated histories MacBook-Pro:site-master admin$ git push -u origin master Enter passphrase for key '/Users/admin/.ssh/id_rsa': To github.com:admin/site.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'git@github.com:adimn/site.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.
fetch>merge>pullするもconflict
MacBook-Pro:site-master adimn$ git fetch Enter passphrase for key '/Users/admin/.ssh/id_rsa': MacBook-Pro:site-master admin$ git merge master Already up to date. MacBook-Pro:site-master admin$ git pull origin master Enter passphrase for key '/Users/admin/.ssh/id_rsa': Enter passphrase for key '/Users/admin/.ssh/id_rsa': From github.com:admin/site * branch master -> FETCH_HEAD fatal: refusing to merge unrelated histories ¥MacBook-Pro:site-master admin$ git pull origin master --allow-unrelated-histories Enter passphrase for key '/Users/adimn/.ssh/id_rsa': From github.com:admin/site * branch master -> FETCH_HEAD warning: Cannot merge binary files: .DS_Store (HEAD vs. 07b6d0404470b6e89ede9033699560c7fad14b2d) Auto-merging README.md CONFLICT (add/add): Merge conflict in README.md Auto-merging .DS_Store CONFLICT (add/add): Merge conflict in .DS_Store Automatic merge failed; fix conflicts and then commit the result. MacBook-Pro:site-master admin$
サイトを見て調べて試行錯誤するも泥沼にはまっている気がします。。。
どなたかご教授願えませんでしょうか。。よろしくお願いいたします。。。。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。