我最近在https://github.com/me/myRepo
上添加了一個回購。 然後本地(在我的電腦上)我刪除了一個文件rm ~/myDir/myFile
我現在想讓它在github上消失而沒有成功。我所做的:如何刪除github上的文件(遠程)
cd ~/myDir
git rm myFile (I had already remove the file physically)
git add -A
git push
但文件仍然存在......
當我做
git commit -a
git push
這不是工作,我得到
[email protected]:~/.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")
[email protected]:~/.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.
正如錯誤消息所述,您的推送被拒絕。先做一個'git pull'。 – tobiasbayer 2013-02-17 12:53:00
工作!感謝隊友,我會盡快接受 – statquant 2013-02-17 12:55:01