GIT: Better method of setting up fresh repo
With creating a fresh git repo, I am wanting to know what is best practice. Ether creating the git repo locally and pushed, or remotely and pulled.
Local machine (inside whatever project folder)
git init git add . git commit -m 'initial commit' git remote add origin <server-repo-url> git push --all origin
Or is it better practice to set up the repo on the server and then pull from it onto your local machine?
mkdir myrepo.git cd myrepo.git git --bare init
Or does it even matter?
2 Solutions collect form web for “GIT: Better method of setting up fresh repo”
It doesn’t particularly matter. Git is designed to allow the equivalent repositories to be shared between clients and servers. So long as your client(s) are fully configured to work with a repository on the server, they’re both great.
Doesn’t matter. Either repo can be discarded once both are up and running.