qeelee

设置全局的.gitignore

我在mac上使用Sublime Text的SFTP/FTP插件,本地编辑代码,再sftp到远程机器调试。
这个插件会在本地的git仓库目录中生成一个sftp-config.json文件,所以就算提交了所有code,git工作区还是不干净的。

例如:

felix@qeelee-mac:~/Work/Knowledge/Openstack/source_code/cinder|Bug1515900⚡
⇒  gst
On branch Bug1515900
Untracked files:
  (use "git add <file>..." to include in what will be committed)

    sftp-config.json

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

所以想设置一个全局的变量,让git忽略所有的sftp-config.json。

参考这篇文章,设置如下:

felix@qeelee-mac:~/Work/Knowledge/Openstack/source_code/cinder|Bug1515900⚡
⇒  echo "sftp-config.json" > ~/.gitignore
felix@qeelee-mac:~/Work/Knowledge/Openstack/source_code/cinder|Bug1515900⚡
⇒  git config --global core.excludesfile ~/.gitignore
felix@qeelee-mac:~/Work/Knowledge/Openstack/source_code/cinder|Bug1515900
⇒  gst
On branch Bug1515900
nothing to commit, working directory clean

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-03-02
  • 2021-12-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
  • 2021-06-23
猜你喜欢
  • 2021-12-21
  • 2021-12-21
  • 2022-01-19
  • 2021-12-21
  • 2022-12-23
  • 2021-10-23
相关资源
相似解决方案