LoginSignup
36
28

More than 5 years have passed since last update.

gitでfooとfoo/barというブランチは同時には作成できない

Last updated at Posted at 2013-03-05
$ git co -b foo
$ git co -b foo/bar
error: unable to resolve reference refs/heads/foo/bar: Not a directory
fatal: Failed to lock ref for update: Not a directory

ブランチを作ると,そのブランチの指すコミットのsha1を保存するためにrefs/heads/BRANCH_NAMEというファイルを作る.このときブランチ名に/が入っているとディレクトリを作成してからファイルを作る.
そのためgit co -b foo/bar時にfooディレクトリを作ろうとするが,既にファイルが存在するためエラーとなる.

36
28
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
36
28