What is the right way to set up a new remote repo in Git? (Original remote
repo is lost)
The remote repo I was using is gone now. My local repo has all my history
and everything I need. I set up a new remote repo by creating the users,
the ssh access, a group called developers, and the directories. Then I
created symlinks to the repos in the home directories of each user. Then I
initiated the remote repos as follows:
git init --bare --shared=group
chgrp -R developers .
On my local machine I edited ~/.ssh/config and defined the new host along
with the identity file required for that host. Then I edited .git/config
and changed remote URL as required. git remote -v reports the expected new
origin.
Now my question is, which of the following two options (assuming one is
correct) do I need to do next? I have seen both of these recommended and I
don't know which is appropriate for my situation.
Choice 1:
git push -u origin master
Choice 2 (but I believe I would skip the first two 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 do not understand the command git config master.merge refs/heads/master.
My goal is to first get all my local history onto the new remote repo.
Then I want to be able to make my commits locally and do a git push and
have the new remote repo work as expected. Thanks
No comments:
Post a Comment