嗨,我喜欢Git,但似乎与人和朋友分享Windows项目并不好玩,因为与tortoisehg或tortoisesvn(不是它的DVCS)相比,gitextensions tortoisegit开箱即用是丑陋的.在bash shell中使用msysgit并不像linux/Mac那样好.
那么有没有新的竞争者(alpha项目等(甚至与其他libs))?
我很想看到这些新的Git库腾飞!
我找到了一种方法,git不会要求你藏匿,而是默默地删除你认为在.gitignore中安全的文件.即使您在初始提交后拥有相同的忽略文件,也是如此.
当您在提交中删除了所述文件但在.gitignore中列出然后您签出另一个存在的提交时,会发生此问题:
git init
mkdir ignored/
echo stuff > ignored/file
echo otherstuff > otherfile
git add -A
# Opps added my ignored folders files
# Forgeting to rm --cache
echo ignored/ > .gitignore ; git add .gitignore
git commit -m 'accidentally add ignored/file'
git status
touch dummyfile; git add dummyfile
# Remembered to rm --cache
git rm --cache -rf ignored/file #This file is now vulnerable to clobber
git commit -m 'add stuff'
echo somechange >> ignored/file
## Wait for it.. …Run Code Online (Sandbox Code Playgroud) 我尝试使用rsync --filter=':+ .gitignore' (-/ exclude作品,但不包括)无济于事。
基本上,我只想在脚本中包含.ignore文件,并使用rsync将其中的所有内容上传到远程服务器。
如果有人能够将sed或awk .gitignore放入适合包含在--filter='merge file' etc中的文件中,我将不胜感激!
或者替代地,一种使rsync理解.gitignore包含的方式。
https://www.kernel.org/pub/software/scm/git/docs/gitignore.html '样式格式'
http://linux.die.net/man/3/fnmatch
https://git.samba.org/?p=rsync.git;a=blob_plain;f=wildtest.txt;hb=HEAD
https://git.samba.org/?p=rsync.git;a=blob_plain;f=wildtest.c;hb=HEAD
rsync中的某些问题bla/仅表示该目录,bla/*表示该目录中的文件,表示该目录bla/**下的bla/***所有内容(包括子目录),最后表示bla及其所有内容,但git可能具有的所有内容bla/
但是排除规则似乎是兼容的。
有没有办法可以检查一切,以便从我的工作目录中删除所有跟踪的文件?
通过这种方式,我可以使用普通的ls命令查看所有未跟踪的文件.
此外,git add .如果我只是想在检查我来自的分支时添加未跟踪的内容,我就可以存储新索引.
我通常会看到初始化与赋值的示例,如下所示:
int funct1(void)
{int a = 5; /*initialization*/
a = 6;} /*assignment*/
Run Code Online (Sandbox Code Playgroud)
显然,垃圾或未定义的东西在某种程度上是未初始化的.
但有人可以定义是否为定义语句保留初始化和/或是否可以将赋值称为初始化?
int funct2(void)
{int b;
b = 5;} /*assignment, initialization or both??*/
Run Code Online (Sandbox Code Playgroud)
是否有很多技术上的原因我们不能说int b被初始化为垃圾(从编译器的角度来看)?
如果可能的话,这可以与初始化和分配非原始数据类型进行比较.