2011-08-15 117 views
0

更新 - 与git企业已知的问题。使用unfuddle和subtree merge现在作品导入本地git回购远程服务器回购

我一直在使用Git在本地机器上进行本地开发。它从未被推到远程回购。

我刚刚注册了一个企业git帐户。我现在想将我的本地仓库导入到新创建的远程仓库仓库中,并维护历史记录。

试图按照答案here,虽然收到

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'. 

所以然后试图

git clone repourl/project.git 
cd project 
git remote add other /tmp/myproject 
git checkout master 
git commit 
git push 

当我做git的承诺收到

On branch master 
nothing to commit (working directory clean) 

做混帐推收到

Everything up-to-date 

虽然如果我做“ls”我会看到我所有的文件。 如果我做“git log”,我会看到我的版本历史记录。

+0

你如何推动你的本地回购?什么命令给你错误信息? – Andy

回答

0

切换到github和bitbucket私人回购。至少当我尝试时,企业git太bug了

0

难道不是一个简单的推动工作?

这是我觉得需要:

  1. 作为远程添加企业混帐到现有的本地仓库(其中包含所有数据)。
  2. 然后git push <enterprise-remote-name> <branch-name>会将您本地仓库上的指定分支推送到企业仓库,将它的所有提交历史记录。

我还没有使用企业git,但我每天都使用github,上述两个步骤会做你正在寻找的东西。

0

只是为了防止在您负责远程服务器时寻找解决方案:使用git init --bare而不是仅仅使用git init来初始化服务器的存储库。

+0

然后我开始变得'致命的:这个操作必须在工作树中运行'当试图使用远程 – gman