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 diff tool on every commit?
  • Git on Windows: What do the crlf settings mean?
  • Git fails to revert: Found a swap file “COMMIT_EDITMSG.swp”
  • git fetch origin --prune doesn't delete local branches?
  • Find tag information for a given commit
  • Upgrading git from the source repository in Ubuntu
  • 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

  • Error to Import Github project into Eclipse?
  • egg.el is loaded but egg-minor-mode is not enabled (no “C-x v” key bindings)
  • Can't git checkout after moving a folder
  • cannot rebase: you have unstaged changes git
  • Git: branches without a corresponding file in refs/heads
  • Keep commit message subject under 50 characters in SourceTree
  • 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.