LoginSignup
30
26

More than 5 years have passed since last update.

かなりいい加減なgitエラー解決方法

Last updated at Posted at 2013-11-02
error: src refspec master does not match any.
error: failed to push some refs to 'git@github.com:xxxx.git'

pushしたときにおこる。変更をコミットしてない可能性がある。


fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

git push --set-upstream origin master

おそらく、まっさらなリポジトリにpushする場合起きる。表示されているコマンドをすればpushが成功する。


$ git clone git@bitbucket.org:o-kuhiiro/hogehoge.git
Cloning into 'hogehoge'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

クローンに失敗した。ローカルのフォルダにinitしてのプッシュもできない。鍵の設定は間違いない。
とりあえず、クローンするフォルダを別のところにしたらできた。フォルダの権限の問題?


エラーじゃないけど、Source TreeでなぜかPushできない。応答が帰ってこなくなる。コマンドでやると上記のエラーもでる。
Source Treeの[ツール] - [オプション] - [SSHクライアントの設定] - [SSHキー]で設定しているキーと、.ssh/configのIdentityFileが間違っていた。


$ git cherry-pick 123456789abcdefg
\# On branch master
nothing to commit (working directory clean)
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:
    git commit --allow-empty
Otherwise, please use 'git reset'

多分、もう既にチェリーピックされている。


error: Your local changes to the following files would be overwritten by merge:
        Atlas.asset
        Material.mat
        SkeletonData.asset
Please, commit your changes or stash them before you can merge.
Aborting

ローカルでgit管理下に置いたファイルがmerge元では管理していないので先にコミットしろみたいな感じか。
commitしたら、mergeできるようになった。


SourceTreeでpushしたら成功しているのに下記エラーがでた。

Updates were rejected because the tag already exists in the remote.
git pull --tags

したらでなくなった。

30
26
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
30
26