git SourceTree 中停止跟踪和丢弃文件有什么区别 [英] What is the difference between Stop Tracking and Discard File in git SourceTree

查看:109
本文介绍了git SourceTree 中停止跟踪和丢弃文件有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道在 git 中使用 source-tree 丢弃文件和停止跟踪文件之间有什么区别.如果我在更新的代码中删除了一个文件,并且我也希望在存储库中删除该文件,我应该将其标记为停止跟踪还是应该在提交过程中丢弃它

I wanted to know what the difference is between discarding a file and and stop tracking a file in git using source-tree. If I deleted a file in my updated code and I want that file deleted on the repository too should I mark it as stop tracking or should I discard it during the commit process

推荐答案

在 SourceTree 中,在文件上选择丢弃"只会丢弃您的本地更改;停止跟踪会将其从存储库中删除.但是,只要您删除了本地驱动器上的文件,并且您可以在 SourceTree 的暂存文件"部分中看到该删除,那么当您提交时,它也会在存储库中被删除.

In SourceTree, selecting "discard" on a file just throws away your local changes; stop tracking removes it from the repository. However, as long as you have deleted the file on your local drive, and you can see that deletion in the "Staged Files" section of SourceTree, it will be deleted in the repository as well when you commit.

这篇关于git SourceTree 中停止跟踪和丢弃文件有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆