0

最近、レポを追加しましたhttps://github.com/me/myRepo。次に、ローカルで(自分のコンピューターで)ファイルを削除しましたが、rm ~/myDir/myFile 現在githubで削除しようとしていますが、成功しませんでした。やった:

cd ~/myDir
git rm myFile (I had already remove the file physically)
git add -A
git push

しかし、ファイルはまだそこにあります...

私がする時

git commit -a
git push

これは機能していません。

statquant@euclide:~/.vim$ git commit -a
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#   (commit or discard the untracked or modified content in submodules)
#
#   modified:   bundle/Align (untracked content)
#   modified:   bundle/Clang_Complete-Pathogen (untracked content)
#   modified:   bundle/Vim-R-plugin (untracked content)
#   modified:   bundle/bash-support.vim (untracked content)
#   modified:   bundle/git (untracked content)
#   modified:   bundle/nerdtree (untracked content)
#   modified:   bundle/perl-support.vim (untracked content)
#   modified:   bundle/snipmate (modified content, untracked content)
#   modified:   bundle/tasklist (modified content)
#
no changes added to commit (use "git add" and/or "git commit -a")
statquant@euclide:~/.vim$ git push
To https://github.com/statquant/.vim.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/statquant/.vim.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again.  See the
'Note about fast-forwards' section of 'git push --help' for details.
4

4 に答える 4

3

プッシュする前に削除をコミットする必要があります:

rm file
git commit -a
git push
于 2013-02-17T12:47:48.040 に答える
1

変更をコミットできません。

$ cd ~/myDir
$ git rm myFile
$ git commit -a -m "Your commit message"
$ git push origin master
于 2013-02-17T12:48:22.190 に答える
0

github のすべての履歴からファイルを削除したい場合は、この をお読みください。それ以外の場合は、他のみんなが言ったように変更をコミットしてください。

于 2013-02-17T12:48:40.197 に答える