我正在尝试在远程 Web 服务器上设置 GIT 存储库并将其连接到我的 Eclipse 上的项目,但在这样做时遇到了麻烦。我已经完成了我的功课并尝试了我能做的一切,但目前处于死胡同。
在远程服务器上创建存储库。在本地计算机上创建存储库。创建连接到本地计算机存储库的项目。尝试了所有方法来连接两个存储库。不可能的。
是的,这是我尝试过的方法之一。
我在远程服务器上创建了一个 git repo。
然后我导入了一个项目并提供了我的服务器信息以连接到 repo。
我能够连接,它为项目提供了我服务器上的所有文件。
我对文件进行了更改,然后转到“团队 > 阶段 > 提交 > 推送”。
我收到此错误'远程:错误:拒绝更新签出分支:refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To ssh://sofiane@50.63.180.135/var/www/html/lms
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'ssh://sofiane@50.63.180.135/var/www/html/lms'
大约 8 小时后,我完全陷入了书呆子的愤怒,把我的键盘砸在墙上。引入流行的版本控制工具的好方法。
这完美地说明了我的挫败感。与 Git 见鬼去吧。你好颠覆,我想你了。