如何使用两个存储库处理 git
这可能是一个新手问题,所以我提前为我的愚蠢道歉。
我正在部署到 Heroku,并通过 github 管理我的存储库。所以我有两个 git 帐户和一个代码库。我的 .git/config 看起来像这样:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
[remote "origin"]
url = [email protected]:gotoAndBliss/True-Jersey.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[remote "heroku"]
url = [email protected]:jersey.git
fetch = +refs/heads/*:refs/remotes/heroku/*
问题是当我执行 git status 时,它声称工作目录是干净的,并且没有任何可提交的内容,因为它只是引用到我的原点
。我如何让它知道它对heroku来说是脏的,以便我可以将最新更改推送到我的heroku存储库?
谢谢!
This is probably a novice question, so I apologize for my daftness ahead of time.
I am deploying to Heroku, and managing my repository through github. So I have two git accounts with one code base. My .git/config
looks like this :
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
[remote "origin"]
url = [email protected]:gotoAndBliss/True-Jersey.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[remote "heroku"]
url = [email protected]:jersey.git
fetch = +refs/heads/*:refs/remotes/heroku/*
The trouble is when I perform git status
, it claims the working directory is clean and that there is nothing to commit because it's only referring to my origin
. How do I get it to know its dirty for heroku so i can push the latest changes to my heroku repository?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“无需提交”与 origin 等遥控器没有任何关系。它只是意味着您的工作树和本地存储库中的当前提交之间没有区别。
但是,您可能会看到类似“您的分支领先于 'origin/master' 1 次提交”之类的提示。这是您真正想要的提醒,确实它仅指一个远程,即您当前分支正在跟踪的远程分支(通常是起源)。不过,这只是一个提醒。您可以运行类似的操作:
将所需的分支推送到所需的远程,无论是 origin (指 github)还是 heroku。
"Nothing to commit" doesn't have anything to do with remotes like origin. It simply means that there is no difference between your work tree and the current commit in your local repository.
You may, however, see hints like "Your branch is ahead of 'origin/master' by 1 commit". This is the reminder you're really wanting, and it's true that it only refers to one remote, the one your current branch is tracking a remote branch from (generally origin). However, it's just a reminder. It's up to you to run something like:
to push the desired branch(es) to the desired remote, whether it be origin (referring to github) or heroku.
查看
http://suitmymind.com/blog/2009/06/02/deploying-multiple-environments-on-heroku-while-still-hosting-code-on-github
它应该有帮助。
我认为通常你会做类似
git push heroku master 的
事情,它会将你的 master 推送到 heroku
check out
http://suitmymind.com/blog/2009/06/02/deploying-multiple-environments-on-heroku-while-still-hosting-code-on-github
It should help.
I think normally you would just do something like
git push heroku master
and it would push your master to heroku