I have a local git repo with some history.
I would like to add it to my remote git server:
# On my server, I create a remote repo
git init project.git --bare --shared
# On my local computer, I add the remote repo
git remote add origin user@server:/srv/git/projet.git
# Try to push
git push origin master
# error: src refspec master does not match any.
# error: failed to push some refs to 'user@server:/srv/git/projet.git'
# Try to pull
git pull origin master
# fatal: Couldn't find remote ref master
# fatal: the remote end hung up unexpectedly
If I clone the remote repo first, then copy the source code, I will lose the git history.
Anyone knows how to do it ?