Reputation:
I'm having a hard time grasping how I can accomplish the below task:
I'm having a difficult time determining what exactly needs to happen. For Step 3, I would think I'd do a fetch or a pull, but (unless I'm reading this wrong) that only seems to pull down new and updated files. There could potentially be old files in that repository, but because Computer2 has none of them I'd want them all (I guess an actual copy of the repository).
I wouldn't think I'd want to create a branch or fork the repository, because I'm not looking for 2 separate versions out there.
And as for Step 4, once the prior steps were complete I would think on each computer I'd just do a pull to get the updated files.
Is my understanding correct, and if not how am I to accomplish the above tasks?
Upvotes: 0
Views: 378
Reputation: 22717
Alternate:
Clone from Computer 1 to Computer 2. Then, you can work between your two computers, pushing from 2 to 1 as if 1 was the master for 2. When you're finally ready to push to GitHub, either computer can be used to push to GitHub, but default behavior makes it easier to do from computer 1.
Upvotes: 0
Reputation: 527258
You want to clone
the github repository on Computer2.
From then on, when you're done doing work on a given computer, you'll need to push
your changes to github (to update your online copy), and then when you arrive at the other computer, pull
those changes from github to the local copy to update it.
Computer1 --push--> GitHub
Computer1 GitHub --clone--> Computer2
changes
|
|
v
Computer1 --push--> GitHub Computer2
Computer1 GitHub --pull---> Computer2
changes
|
|
v
Computer1 GitHub <--push--- Computer2
Computer1 <--pull-- GitHub Computer2
Upvotes: 3
Reputation: 8488
First install git and then clone
your repository with the url you get from github. Afterwards all you need to do is pull and push to keep the two in sync.
Upvotes: 3