2

Git使用常见问题汇总

 2 years ago
source link: https://lianpf.github.io/posts/%E5%BC%80%E5%8F%91%E6%97%A5%E8%AE%B0/git%E4%BD%BF%E7%94%A8%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98%E6%B1%87%E6%80%BB/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Git使用常见问题汇总

2021-08-06

1..gitignore忽略文件无效

问题:.gitignore中已经标明忽略的文件目录下的文件,git push的时候还会出现在push的目录中

原因:在git忽略目录中,新建的文件在git中会有缓存,如果某些文件已经被纳入了版本管理中,就算是在.gitignore中已经声明了忽略路径也是不起作用的,这时候我们就应该先把本地缓存删除,然后再进行git的push,这样就不会出现忽略的文件了

git清除本地缓存命令如下:

git rm -r --cached .
git add .
git commit -m 'update .gitignore'

最后, 希望大家早日实现:成为前端高手的伟大梦想!
欢迎交流~

微信公众号

本文版权归原作者曜灵所有!未经允许,严禁转载!对非法转载者, 原作者保留采用法律手段追究的权利!
若需转载,请联系微信公众号:连先生有猫病,可获取作者联系方式!

曜灵 avatar
博主目前就职于X集团上海研发中心-平台工具组,是一名Web开发工程师。技术领域涉及 React技术栈、Vue技术栈、Hybrid、工程化,及node BFF层等相关内容。工作之余,积极为社区贡献自己的绵薄之力,现有若干独立的开源项目

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK