首页 > 解决方案 > 为什么存在未跟踪文件时 git describe 不给我脏后缀?

问题描述

git status给我看一些未跟踪的文件。但git describe没有给我脏旗。为什么?

user@host:~$ git status
On branch master
Your branch is ahead of 'origin/master' by 16 commits.
  (use "git push" to publish your local commits)

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        
nothing added to commit but untracked files present (use "git add" to track)
user@host:~$ git describe --dirty --tags
v0.3-4-3-geadf778

标签: git

解决方案


--dirty查找跟踪文件上未提交的修改;未跟踪的文件被完全忽略。

如果你想让 git “感知”额外的文件,你可以使用git add file1 file2 ...git add --intent-to-add file1 file2 ...


推荐阅读