我对 git 还是很陌生,并试图弄清楚一切是如何工作的。所以这是我的情况:我一直在我的笔记本电脑上开发一个 Java 项目。推送到 git 存储库并将其拉到另一台机器上。进行了一些更改并推送到存储库。现在我想将我当前的工作拉到我的笔记本电脑上,但它说我不能,因为我有未合并的文件。
Pull is not possible because you have unmerged files.
Please, fix them up in the work tree, and then use 'git add/rm <file>'
Run Code Online (Sandbox Code Playgroud)
请帮助纠正此问题。谢谢你。
$ git status
on branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
You have unmerged paths.
(fix conflicts and run "git commit")
Run Code Online (Sandbox Code Playgroud) 每当我在不同的 ruby 文件中加载 ruby 类文件时,它都会执行正在导入的类文件。该类文件当前在类定义之外实例化并调用方法。有没有办法阻止导入的文件执行?当我运行单元测试时也会发生这种情况。我尝试了以下方法:
load 'file.rb'
require_relative 'file'
require "./file.rb"
Run Code Online (Sandbox Code Playgroud)
谢谢。
这是我在类文件中的内容(我正在尝试导入):
class Nim
#some stuff
end
nim = Nim.new(Player.new)
nim.start_game
nim.configBoard
Run Code Online (Sandbox Code Playgroud)