2017-12-07 25 views
2
$ git log 
commit 49a37bc9fd27c909e4fe77812041fd38b9755f61 (HEAD -> master) 
Author: chenghuang <[email protected]> 
Date: Thu Dec 7 14:15:42 2017 +0900 

useless 

commit e9b08e2b428f9dd58aa0b792ebeb29da4270dfab 
Author: chenghuang <[email protected]> 
Date: Tue Dec 5 22:45:31 2017 +0900 

20171205_Checklist_well 

私のgitログにコミットするだけです。gitは私の更新をリモートにプッシュできません

$ git branch #my current branch is master 
* master 

$ git remote -v #This is my remote github url 
origin https://github.com/ekoopgj/Shell_learning.git (fetch) 
origin https://github.com/ekoopgj/Shell_learning.git (push)  

$ git push -u origin master 
Username for 'https://github.com': 
Password for 'https://[email protected]': 
To https://github.com/ekoopgj/Shell_learning.git 
! [rejected]  master -> master (fetch first) 
error: failed to push some refs to 'https://github.com/ekoopgj/Shell_learning.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. 

更新をリモートにプッシュできません。 「リモートワークにはあなたが含まれている」という意味ですか?

+0

私の答えには何か不足していますか? – VonC

答えて

2

完全な文では、あなたの前に、リモート・マスターにプッシュしている人を意味

the remote contains work that you do not have locally. 

です。

git pull(またはbetter: git pull --rebase)を使用すると、それらの変更を取得して元の状態に戻すことができます。

+0

なぜ 'pull --rebase'が優れていますか? – evolutionxbox

+0

@evolutionxboxなぜ私はhttps://stackoverflow.com/a/47606777/6309で説明します – VonC

1

これは、ソースコードのコピーが最新でなく、不一致の原因であることを意味します。マスターから最新のものを取り、別の場所にいる可能性があります。変更をマージしてもう一度やり直してください。