import local git repo to remote server repo
更新-Git Enterprise的已知问题。用过的"不定式"和"子树合并"现在可以工作了
我只在我的机器上使用git进行本地开发。它从未被推到远程回购。
我刚注册了一个企业Git账户。现在我想将本地回购导入新创建的远程git回购并维护历史记录。
尝试按照这里的答案,尽管接收
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | remote: error: refusing to update checked out branch: 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'. |
然后尝试
1 2 3 4 5 6 | git clone repourl/project.git cd project git remote add other /tmp/myproject git checkout master git commit git push |
当我收到Git Commit时
1 2 | On branch master nothing to commit (working directory clean) |
执行git推送接收
1 | Everything up-to-date |
但是如果我做"是",我会看到我所有的文件。如果我做"Git日志",我会看到我的版本历史。
以防有人在您同时负责远程服务器时寻找解决方案:用
切换到GitHub和BitBucket私有回购。企业Git太麻烦了,至少在我尝试的时候
一个简单的推动就不能完成这项工作吗?
以下是我认为需要的:
我没有使用过企业Git,但是我每天都使用GitHub,上面的两个步骤可以满足您的需求。