git - 为什么 Git 会在我的文件中放入随机字母?
问题描述
我正在尝试在运行 Ubuntu Server 的 Raspberry Pi 上托管 Discord 机器人。我正在尝试通过将文件上传到 GitHub 存储库(公共)然后让 Raspberry Pi 拉取更改来对其进行更新。我先采取这些步骤L
git init
git add .
git commit -m "test"
git branch -M master
git remote add origin (MY_PUBLIC_REPO_LINK)
git push origin master
没关系。然后我运行我的 Jishaku pull 命令......它给了我这个错误:
[stderr] warning: Pulling without specifying how to reconcile divergent branches is
[stderr] discouraged. You can squelch this message by running one of the following
[stderr] commands sometime before your next pull:
[stderr]
[stderr] git config pull.rebase false # merge (the default strategy)
[stderr] git config pull.rebase true # rebase
[stderr] git config pull.ff only # fast-forward only
[stderr]
[stderr] You can replace "git config" with "git config --global" to set a default
[stderr] preference for all repositories. You can also pass --rebase, --no-rebase,
[stderr] or --ff-only on the command line to override the configured default per
[stderr] invocation.
我谷歌它,他们告诉我使用 ff-only 标志。好的。然后,我再次运行命令,出现此错误:
[stderr] From https://github.com/ConchDev/ConchBot
[stderr] * branch master -> FETCH_HEAD
[stderr] fatal: refusing to merge unrelated histories
[status] Return code 128
这就是问题开始的地方。如果我使用强制合并不相关的历史标志,我会在我的文件底部得到这样的东西:
>>>>>>> 699b4f2ba544a5047f22ba6a42b2df5d79635eb4
它把它放在我每个文件的末尾,引发语法错误并拒绝启动程序。我不知道如何解决这个问题,我和我的朋友一直在寻找解决方案。这里有人可以帮忙吗?
解决方案
推荐阅读
- git - 工作树中的 diff 文件与远程跟踪分支中的文件
- typescript - 如何将 ImmutableJS 映射与 TypeScript 一起使用
- android - ViewModel、LiveData 和 Transformations.map
- azure - 如何为 Azure 存储过程提供分区键
- ruby-on-rails - 是否可以在 Heroku 上进行相互 ssl 身份验证?
- c++ - 在另一个类中调用一个类函数(无效使用非静态成员函数)
- angular - 带有授权标头的 Angular/Ionic CORS 错误
- android - android从图像列表视图中的url读取位图
- chai - chai 断言库是否在通过/失败的步骤中返回真/假?
- python - paypal下载账户活动记录