一个用户怎么可能在git中引起冲突? [英] how it can be that a single user causes conflicts in git?

查看:54
本文介绍了一个用户怎么可能在git中引起冲突?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一个远程git存储库,我是唯一一个提交到该存储库且仅提交给主数据库的人,也就是说,没有分支,没有合并.

I am working with a remote git repository, I am the only one who commits into that repository, and only into the master -- that is, no branching, no merging.

大多数情况下都可以正常工作.

Most of the time it works fine.

但是有时候,当我尝试提交和推送时,我收到一些奇怪的快进被拒绝"消息.然后,我尝试通过运行git pull进行同步,使本地副本进入冲突状态:(

But sometimes, when I am trying to commit and push, I am getting some weird "fast forward rejected" message. Then, I am trying to synchronize by running git pull, I am getting my local copy into conflicted state :(

上次它损坏了我的一个二进制文件.

Last time it corrupted one of my binary files.

您知道一个用户进入冲突状态怎么可能发生吗?

Any idea how that can happen that one user gets into conflicted state?

推荐答案

使用git fetch; gitk HEAD...@{u}(或git fetch; git log --graph --decorate --oneline HEAD...@{u})查看正在发生的情况.

Use git fetch; gitk HEAD...@{u} (or git fetch; git log --graph --decorate --oneline HEAD...@{u}) to see what is going on.

只要您的本地分支机构和上游分支机构没有转移,一切都应该没问题.如果他们确实转移了,请检查负责哪种提交.

As long as your local branch and your upstream branch do not divert everything should be fine. If they do divert, check what kind of commit is responsible.

还要确保git status --short始终显示干净状态.闲置未提交的更改可能会给您带来类似的麻烦.

Also make sure that git status --short always shows a clean state. Having uncommitted changes hanging around might get you in similar trouble.

这篇关于一个用户怎么可能在git中引起冲突?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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