Working with 2 separate repos to store your development and production code bases.
In your development repository directory:
Add a remote for the production repository:
git remote add production git@github.com:user/production.gitUpdate remotes and fetch
git remote update
git fetchcreate a new branch in your development repo called production from production/master remote
git checkout -b production production/masterYou now have a few options.
Option 1: Pull all latest commits from development into production branch
git pull origin masterOption 2: Pick a single commit (result of a squash or bug fix) you would like to merge into production
git cherry-pick <SHA hash of commit>If there are merge conflicts, do 2 things:
- fix any merge conflicts and commit
git commit -m "production release 1.0.4"- retrieve production changes and replay your commits on top
git pull --rebasepush current branch head (non-master) to production master
git push production HEAD:masterResources:
http://stackoverflow.com/questions/3598355/i-am-not-able-to-push-on-git#3598399