holman / ama

Ask @holman anything!
732 stars 277 forks source link

Note: One common option is git remotes. #854

Closed xoco70 closed 5 years ago

xoco70 commented 5 years ago

Hi Zach,

I'm applying to a GitHub Solution Engineer position, and one question is:

Hi GitHub! My company has an internal Git server and use GitHub.com. For workflow purposes, how do I sync my repository to both GitHub and the internal Git server? Note: One common option is git remotes.

I think the answer is too easy, it is weird, and beside, there is a unneeded note, because remotes are the obvious choice:

Note: One common option is git remotes.

And everything has a purpose on this test, I feel I'm missing something

My answer:

You can sync your internal git repository with GitHub adding a remote repository. To add a GitHub remote to your internal repository, you can do:

$ git remote -v
origin  https://your-internal-repo.com/group/project (fetch)
origin  https://your-internal-repo.com/group/project (push)

$ git remote add gh https://gitHub.com/group/project
$ git remote -v
origin  https://your-internal-repo.com/group/project (fetch)
origin  https://your-internal-repo.com/group/project (push)
gh  https://gitHub.com/group/project (fetch)
gh  https://gitHub.com/group/project (push)

Do you know what am I missing ?

Note: I find this repo an amazing and successful way to use GitHub!

holman commented 5 years ago

I'd just go with remotes on that one. Don't think you have to overthink anything on this one. :)

xoco70 commented 5 years ago

Tx :) Better 4 eyes than 2 ;)