Different between "git add --all" and "git add ."
发布日期:2021-09-01 17:00:14 浏览次数:2 分类:技术文章

本文共 1027 字,大约阅读时间需要 3 分钟。

hot3.png

At first, I always use "git add ." in the work, but I some times, I find if I remove some files in the track tree,and then push the "New Version" to remote git server, then I still can find the removed files in native git. so how is it? I need to delete the files in the server. So I will do like this:

For File:git rm --cached filenamegit commit -m "delete file in remote git."git push [origin] [master]For Folder:git rm -r --cached foldernamegit commit -m "delete folder in remote git."git push [origin] [master]

It is so non-convenient,right? So how to avoid doing like this?

Way is using "git add --all"

"git add --all" == "git add ." + "git add -u"

"git add ." means track all the files that "new" and "modified";

"git add -u" means track all the files that "modified" and "deleted"

So in the project, if you just use "git add ." to track all the files, it will be work ok, but you should deal with all the dirty files in the remote git server.

Reference link:

Thanks,

Blues

转载于:https://my.oschina.net/u/913344/blog/266406

转载地址:https://blog.csdn.net/weixin_34122810/article/details/92022134 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:Leetcode 227 basic caculator
下一篇:InfiniTabBar

发表评论

最新留言

初次前来,多多关照!
[***.217.46.12]2024年03月24日 12时24分43秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章

【Leetcode刷题篇】leetcode88 合并两个有序数组 2019-04-26
【Leetcode刷题篇】剑指offer51 数组中的逆序对 2019-04-26
【Leetcode刷题篇】剑指offer55-平衡二叉树 2019-04-26
【Leetcode刷题篇】leetcode98 判断一棵树是否为二叉搜索树 2019-04-26
Java中arraylist和数组的相互转换 2019-04-26
【Leetcode刷题篇 】leetcode147 对链表进行插入排序 2019-04-26
【Leetcode刷题篇】leetcode148 排序链表 2019-04-26
【面试篇】Java中String、StringBuilder与StringBuffer的区别? 2019-04-26
【面试篇】Java对象的hashCode()相同,equals()一定为true吗? 2019-04-26
【面试篇】Java中static和final关键字的作用是什么? 2019-04-26
【面试篇】Java中接口和抽象类的区别是什么? 2019-04-26
【Java网络编程与IO流】Java中IO流分为几种?字符流、字节流、缓冲流、输入流、输出流、节点流、处理流 2019-04-26
【Java网络编程与IO流】Java中BIO、NIO、AIO的区别是什么? 2019-04-26
【Leetcode刷题篇】leetcode136 只出现一次的数字 2019-04-26
spring boot整合thymeleaf,支持JSP和HTML页面开发 2019-04-26
【Java网络编程与IO流】Spring boot整合SSE实现服务器实时推送流信息 2019-04-26
【Java网络编程与IO流】SpringBoot + WebSocket + Netty实现实时的服务器消息推送 2019-04-26
【Leetcode刷题篇】leetcode141 环形链表II 2019-04-26
【Leetcode刷题篇】leetcode160 相交链表 2019-04-26
【Leetcode刷题篇】leetcode169 多数元素 2019-04-26