Git:为什么文件删除不同步? [英] Git: why the file deletion does not sync?

查看:227
本文介绍了Git:为什么文件删除不同步?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

新手在这里.我有两个Linux工作站,WS-A和WS-B.

Newbie here. I have two linux workstations, WS-A and WS-B.

我在WS-A上有一个项目,然后将其推送到我在bitbucket上的远程仓库中.

I have a project on WS-A and and then pushed it to my remote repo on bitbucket.

然后我在WS-B上git clone,然后进行了一些修改,并由于某些原因删除了WS-B上的某些文件,然后在WS-B上再次按下了.

And then I git clone on WS-B and then I made a few modifications and deleted some files on WS-B due to some reasons and then on WS-B I pushed again.

但是我很困惑,现在在WS-A上,当我执行git pull时,删除的文件仍然存在!!我该怎么办?我100%确定要删除它们.我是此代码的唯一用户.我只想保留一个版本.

But I am very confused, on WS-A now, when I do a git pull, the deleted files are still there!! What should I do? I am 100% sure I want them to be deleted. I am the only user of this code. I want to keep ONLY ONE version.

推荐答案

是的,您必须使用git rm,否则文件已在工作副本上删除,但未从存储库中删除. git status应该将文件显示为已删除",但未上演提交. git rm; git commitgit push它们,然后从另一个框中的git pull消失了.

Yes you have to use git rm, otherwise the files have been deleted on the working copy, but not from the repository. git status should show the files as 'deleted', but not staged for commit. git rm; git commit and git push them, then git pull from the other box and they will be gone.

这篇关于Git:为什么文件删除不同步?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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