We have one internal remote repository in stash and one repository in github for our third party consultants. We try to synch the repository in "Atlassian Stash" to the repository in GitHub everyday. The procedure I follow is to change the remote to github using set url and pull from github (the branch I desire) to my local directory and then I change the remote again to "stash" and push the changes there from my local directory. Is this a good approach or there is a better way to do it?
2 Answers
As @g19fanatic says, no need to keep changing the remote URL's. Just
git pull <name of stash remote> git push <name of github remote> You need two separate remotes for this; add the second one if needed with git remote add
2 Comments
You can use a hook for that.
You may push to the second repo when the first one triggers post-receive
git stashwhich is usually short-handed to just stash