为什么git checkout of over commit会在我的工作目录中放入未跟踪的文件?

时间:2015-06-21 18:19:23

标签: git

我希望签出不应该在我的工作目录中放置未跟踪的文件。为什么会这样?

$ git status
On branch master
nothing to commit, working directory clean
$ git checkout 7dfd
Note: checking out '7dfd'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 7dfd765... weeeee
$ git status
HEAD detached at 7dfd765
Untracked files:
  (use "git add <file>..." to include in what will be committed)

    rel/

nothing added to commit but untracked files present (use "git add" to track)

0 个答案:

没有答案