当我做一个
// this is in a bash script
git add -A .
git commit -m $a
git push test master
如何选择一个单独的.gitignore文件。上面的方法使用.gitignore,但我想使用一个名为.gitignore1的类似文件。
如何指定要使用的.gitignore文件?
函数- p1
p1() {
git config --local core.excludesfile = /Users/a/root/.gitignore1
a=$1
if [ $# -eq 0 ]
then
目前正在做一个脱离主程序的分支,并在.gitignore中添加了一些内容。我提交了所有的更改并尝试查看另一个分支,但我得到:
error: Your local changes to the following files would be overwritten by checkout:
.gitignore
Please, commit your changes or stash them before you can switch branches.
Aborting
当我运行git status时,我得到:
On branch feature/blahblah
nothing to
我的.gitignore文件如下所示:
html/
cache/
resources/
# Temp files often created by editors
*.~
我知道我希望开始跟踪html中的特定目录,所以我添加了`!html/support/
html/
cache/
resources/
# Temp files often created by editors
*.~
# Track support
!html/support/
然而,在这样做之后,Git似乎仍然没有跟踪html/support/及其所有子目录。
如何将之前忽略的目录添加到Git库中?