如何使用两个存储库处理 git

发布于 2024-10-05 05:05:56 字数 991 浏览 2 评论 0原文

这可能是一个新手问题,所以我提前为我的愚蠢道歉。

我正在部署到 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

五里雾 2024-10-12 05:05:56

“无需提交”与 origin 等遥控器没有任何关系。它只是意味着您的工作树和本地存储库中的当前提交之间没有区别。

但是,您可能会看到类似“您的分支领先于 'origin/master' 1 次提交”之类的提示。这是您真正想要的提醒,确实它仅指一个远程,即您当前分支正在跟踪的远程分支(通常是起源)。不过,这只是一个提醒。您可以运行类似的操作:

git push <remote>            # push all matching branches
git push <remote> <branch>   # push one branch

将所需的分支推送到所需的远程,无论是 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:

git push <remote>            # push all matching branches
git push <remote> <branch>   # push one branch

to push the desired branch(es) to the desired remote, whether it be origin (referring to github) or heroku.

鸠书 2024-10-12 05:05:56

查看

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文