我错误地使用命令将文件添加到git:
git add myfile.txt
Run Code Online (Sandbox Code Playgroud)
我还没跑git commit.有没有办法撤消这个,所以这些文件不会包含在提交中?
到目前为止有48个答案(有些已删除).除非您有一些新信息,否则请不要添加新的.
我试图在我的.gitignore文件中避免以下模式.
MyPrject/WebApp/Scripts/special/*.js
MyPrject/WebApp/Scripts/special/*/*.js
MyPrject/WebApp/Scripts/special/*/*/*.js
MyPrject/WebApp/Scripts/special/*/*/*/*.js
MyPrject/WebApp/Scripts/special/*/*/*/*/*.js
MyPrject/WebApp/Scripts/special/*/*/*/*/*/*.js
MyPrject/WebApp/Scripts/special/*/*/*/*/*/*/*.js
Run Code Online (Sandbox Code Playgroud)
我们尝试了:
MyPrject/WebApp/Scripts/special/**.js
MyPrject/WebApp/Scripts/special/**/*.js
Run Code Online (Sandbox Code Playgroud)
然而,这不起作用.这是Windows上的git.有没有更简洁的方法来做到这一点而不重复的事情?