のいずれかを引っ張っしたくない、拒否された。ここにgitの状態です:Gitのプッシュが
Macs-MacBook:crime_type_class_mlmodel macuser$ git status
On branch master
Your branch and 'origin/master' have diverged,
and have 2 and 9 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
deleted: 20170628_somefile.txt
deleted: model.R
deleted: somecsv.csv
deleted: somecsv1.csv
modified: rscripts/.RData
modified: rscripts/.Rhistory
modified: rscripts/preprocessing.R
deleted: somecsv2.csv
Untracked files:
(use "git add <file>..." to include in what will be committed)
.DS_Store
.RData
.Rhistory
database snippets.sql
output_csvs/
私がコミットしようとしています私のローカルディレクトリからgithubへの2つのファイル。
のMac-のMacBook:crime_type_class_mlmodelのマックユーザー$ git pull origin master
From https://github.com/ourco/myprojectrepo.git
* branch master -> FETCH_HEAD
error: Your local changes to the following files would be overwritten by merge:
rscripts/.RData
rscripts/.Rhistory
Please, commit your changes or stash them before you can merge.
Aborting
これら2つのファイル.RDataと.RHistoryにはないメッセージにより示唆されるように
git push origin master
To https://github.com/ourco/myprojectrepo.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/ourco/myprojectrepo.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のプルを試してみましたブラウザにアクセスしたときにレポに表示されます。私はgithubでそれらをしたくないし、私はそれらをローカルで上書きしたくない。これらの2つのファイルは私のローカルディレクトリにあるはずです。だから、私はそれらを上書きすることに懸念している。
model.Rファイルとpreprocessing.Rファイルの両方をgithubにコミットする方法はありますか?
.Gitignoreファイルに.RDataと.Rhistoryを追加することをお勧めします。 R – shaojl7