Skip to content

Instantly share code, notes, and snippets.

@libitte
Last active December 18, 2015 16:29
Show Gist options
  • Select an option

  • Save libitte/5811790 to your computer and use it in GitHub Desktop.

Select an option

Save libitte/5811790 to your computer and use it in GitHub Desktop.
git checkout another_branch -- path_to_file

git checkout "--" をつけることによって他のオプションなのかパスが来るのか判断している。

git checkout [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <paths>.

こういうケースとかには "--" がないとつらい。

git checkout <tree-ish> <path1> <path2>
git checkout <path1> <path2> <path3>

"--"つけると便利。

git checkout <tree-ish> -- <path1> <path2>
git checkout -- <path1> <path2> <path3>
@libitte
Copy link
Author

libitte commented Jun 19, 2013

参考: [http://stackoverflow.com/questions/2531204/in-git-checkout-files-what-does-mean]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment