2010年5月21日 星期五

GIT 雜七雜八的問題及解決

1.其他人push過後就不能push了

gigijoe@gigijoe-desktop:~/DSPG8181$ git push
To git@localhost:DSPG8181.git
 ! [rejected]        HEAD -> master (non-fast forward)
error: failed to push some refs to 'git@localhost:DSPG8181.git'

也不能pull了

gigijoe@gigijoe-desktop:~/DSPG8181$ git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me either.    Please
specify which branch you want to merge on the command line and
try again (e.g. 'git pull ').
See git-pull(1) for details.

If you often merge with the same branch, you may want to
configure the following variables in your configuration
file:

    branch.master.remote =
    branch.master.merge =
    remote. .url =
    remote. .fetch =

See git-config(1) for details.

git config branch.master.remote origin
git config branch
.master.merge refs/heads/master
git checkout master
git reflog
git pull
git push

另一個解法(沒試過)

git pull origin master

2.沒事整理一下
git fsck --full

3.維護資料庫 (會跑一陣子,用很多記憶體)
git gc


1 則留言:

  1. git fsck --full
    [版主回覆07/19/2011 17:08:04]感謝

    回覆刪除