We use a git server for managing our services and now we want to publish some of them on Github. Now we need to transfer project after each commit from our current git server to Github.
What is you solution?
First of all you have to create project on github.
Once You have the project you will need to push the code to github whenever user is committing to his local repository.
This can simply use the git push
command after each commit that you perform. This is the most common way to push changes to the remote repo.
Another way (less recommended) is to use git hooks. The problem with the client hooks is that user can delete them and then the hooks will not work.
So the best way is to use git push
# Add all the changes
git add -A .
# commit changes
git commit -m "message"
# push changes to the remote
git push origin <branch>
I find this solution that let me pull/push from multiple remote but it's not my complete answer because I need to set this settings on system of each git members to push on github server
For doing this method open .git\config
file on local repository and find something like this:
[remote "origin"]
url = git@git.ermile.com:/home/git/saloos
fetch = +refs/heads/*:refs/remotes/origin/*
after finding that insert below line after line 2
url = git@github.com:Ermile/Saloos.git
Now you can files must look like this:
[remote "origin"]
url = git@git.ermile.com:/home/git/saloos
url = git@github.com:Ermile/Saloos.git
fetch = +refs/heads/*:refs/remotes/origin/*
Don't forget to change Ermile/Saloos.git
with your rep name from Github!
This solution is client side and if you have a server side solution for doing this automatically let me know:)