git SourceTree中的Stop Tracking和Discard File有什么区别? [英] What is the difference between Stop Tracking and Discard File in git SourceTree

查看:1352
本文介绍了git SourceTree中的Stop Tracking和Discard File有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道放弃文件和停止使用源码树在git中跟踪文件的区别。如果我在已更新的代码中删除了一个文件,并且我希望在存储库上删除该文件,我应该将其标记为停止跟踪,或者在提交过程中丢弃该文件

解决方案

在SourceTree中,在文件上选择放弃只会抛弃您的本地更改;停止跟踪将其从存储库中删除。但是,只要您删除了本地驱动器上的文件,并且您可以在SourceTree的Staged Files部分中看到该删除,它将在您提交时在存储库中删除。

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

解决方案

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中的Stop Tracking和Discard File有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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