Git - 使开发和掌握跟踪不同的存储库。明智吗?
我有一个在 git 中的项目并部署到heroku。远程网址为 [email protected]:myappname.git< /code> 和 .git/config 看起来像这样:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:myappname.git
[branch "master"]
remote = origin
merge = refs/heads/master
我刚刚制作了一个名为“myappname-staging”的新 Heroku 应用程序,我想将其用作该应用程序的暂存站点。我想我应该将其设置为“主”分支推送到生产远程,“开发”分支推送到暂存远程。这是处理这种情况的明智/传统方法吗?
我不太清楚该怎么做。当我在 Heroku 上制作暂存应用程序时,它给了我这样的信息:
Creating myappname-staging.... done
http://myappname-staging.heroku.com/ | [email protected]:myappname-staging.git
Git remote heroku added
我的配置现在看起来像这样:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:myappnamestef.git
[branch "master"]
remote = origin
merge = refs/heads/master
[remote "heroku"]
url = [email protected]:myappname-staging.git
fetch = +refs/heads/*:refs/remotes/heroku/*
[remote "staging"]
url = [email protected]:myappname-staging.git
fetch = +refs/heads/*:refs/remotes/staging/*
谁能帮我纠正一下吗?
谢谢,马克斯
I have a project which is in git and deploys to heroku. The remote url is [email protected]:myappname.git
and the .git/config looks like this:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:myappname.git
[branch "master"]
remote = origin
merge = refs/heads/master
I just made a new heroku app called "myappname-staging" which i want to use as a staging site for this app. I was thinking that i would set it up so that the "master" branch pushes to the production remote and the "development" branch pushes to the staging remote. Is this the sensible/conventional way to handle this situation?
I can't quite figure out how to do this. When i made the staging app on heroku it gave me this back:
Creating myappname-staging.... done
http://myappname-staging.heroku.com/ | [email protected]:myappname-staging.git
Git remote heroku added
And my config now looks like this:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:myappnamestef.git
[branch "master"]
remote = origin
merge = refs/heads/master
[remote "heroku"]
url = [email protected]:myappname-staging.git
fetch = +refs/heads/*:refs/remotes/heroku/*
[remote "staging"]
url = [email protected]:myappname-staging.git
fetch = +refs/heads/*:refs/remotes/staging/*
Can anyone set me straight?
thanks, max
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
添加以下内容:
您可以通过以下方式从命令行执行此操作:
这将设置
development
分支以跟踪暂存时的master
分支。Add this:
You can do that from the command line via:
That will set up the
development
branch to tracking themaster
branch on staging.