version control - What is the right way to set up a new remote repo in Git? (Original remote repo is lost) -


the remote repo using gone now. local repo has history , need. set new remote repo creating users, ssh access, group called developers, , directories. created symlinks repos in home directories of each user. initiated remote repos follows:

git init --bare --shared=group chgrp -r developers . 

on local machine edited ~/.ssh/config , defined new host along identity file required host. edited .git/config , changed remote url required. git remote -v reports expected new origin.

now question is, of following 2 options (assuming 1 correct) need next? have seen both of these recommended , don't know appropriate situation.

choice 1:

git push -u origin master 

choice 2 (but believe skip first 2 steps):

$ git remote rm origin $ git remote add origin git@github.com:aplikacjainfo/proj1.git $ git config master.remote origin $ git config master.merge refs/heads/master $ git push 

i not understand command git config master.merge refs/heads/master.

my goal first local history onto new remote repo. want able make commits locally , git push , have new remote repo work expected. thanks

given hand-edited .git/config, use git push -u origin master. it'll there's left do.