Git fails to push to remote configured as mirror

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

問題

Pushing to a git repository that has been configured as a mirror does not work, reporting an error like this:

error: --mirror and --tags are incompatible

原因

You created the remote outside of SourceTree with the --mirror=push option. This forces git to add --mirror to the command line which is incompatible with some more specific options, such as --tags, which SourceTree uses to push tags by default.

回避策

The --mirror=push remote configuration is really a convenience for the command-line so you don't have to type as much; since SourceTree is more specific about how to push this is going to conflict. Unfortunately git provides no way to override the forced --mirror option so effectively this remote is not usable with SourceTree. Please create another remote pointing to the same location without the forced --mirror option (for example, create it inside SourceTree), or remove this option from the remote in your .git/config .

You should not need the --mirror option with SourceTree anyway since it defaults to selecting your tracked branches in the push dialog, and reducing typing is not an issue.

Last modified on Mar 30, 2016

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.