2016-11-25 15 views
0

2人のユーザーが使用するマスターリポジトリがあります。私は自分のコードをプッシュすると、競合を解消するよう警告します。競合するファイルを自分のリポジトリにマージする方法

私のコードをgitコマンドで既存のコードにマージしたいのですが、この問題を解決する方法がわかりません。

+3

の可能性のある重複[Gitリポジトリでマージの競合を解決する方法は?](http://stackoverflow.com/questions/161813/how-to-resolve-merge-conflicts-in-git) – jonrsharpe

答えて

0
$ git commit -am <message>  # add & commit your local changes 
$ git pull origin master   # pull the latest codes 
$ git status      # see the files that have conflicted (untracked files) 

# If you want to keep your changes then 
$ git checkout . --ours 

# Or, if you want to keep remote changes 
$ git checkout . --theirs 

$ git commit -am <message>   # add & commit with a new message 
$ git push origin master    # push to remote 
+0

私は、コマンドgit pull origin masterエラーを返す:ファイルの結合を解除したために引っ張ることができない –

+1

変更を最初に追加してコミットする必要があります。 'git commit -am ' –