Git – make development and master track different repos. Sensible?

I have a project which is in git and deploys to heroku. The remote url is git@heroku.com: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 = git@heroku.com: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?

  • Git Branch newbie - How to reverse?
  • Remove a certain commit as if it never happened
  • Potential for missed version in Subversion (research setting)
  • How can I git archive an arbitrary branch?
  • git rebase upside down
  • How to update an Heroku App created using github “Deploy to Heroku” button?
  • 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/ | git@heroku.com: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 = git@heroku.com:myappnamestef.git
    [branch "master"]
      remote = origin
      merge = refs/heads/master
    [remote "heroku"]
      url = git@heroku.com:myappname-staging.git
      fetch = +refs/heads/*:refs/remotes/heroku/*
    [remote "staging"]
      url = git@heroku.com:myappname-staging.git
      fetch = +refs/heads/*:refs/remotes/staging/*
    

    Can anyone set me straight?

    thanks, max

  • how do get a clone of a commit from history github
  • error on satellites after upgrade Gitlab from 5.4 to 6.0
  • How to integrate build output from one git repo into another
  • Github how to give authorization to my repository to other people
  • How to continue project from specific commit and fix HEAD detached issue?
  • Cannot make header be indexed
  • One Solution collect form web for “Git – make development and master track different repos. Sensible?”

    Add this:

    [branch "development"]
      remote = staging
      merge = refs/heads/master
    

    You can do that from the command line via:

    $ git config branch.development.remote staging
    $ git config branch.development.merge refs/heads/master
    

    That will set up the development branch to tracking the master branch on staging.

    Git Baby is a git and github fan, let's start git clone.