Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you use Git with multiple computers?

Tags:

git

I'm trying to use git and I have many computers. I usually work on my desktop, but sometimes use laptops.

How do you sync source code on git when you go home from work and you didn't finish working on the code? Do you send a patch file through email or just commit to git the incomplete codes?

I agree the latter is more convenient, but I think it makes the git changelog dirty.

like image 706
Brian Avatar asked Jun 16 '11 00:06

Brian


People also ask

How do I access my git repository on another computer?

in CMD go to folder where you want your app to be cloned to, for example cd C:/my_apps/ login to github and go to app you want to clone, press green button "Clone or Download", you will see SSH link, copy it. in CMD run git clone [email protected]:user/my-app. git (use SSH link you copied)

How do I update a GitHub repository on another computer?

First of all, clone the repo to your new system and then initialize it. Once done this change to that directory and copy or reapply the changes to the cloned repo and then add to it. $ git add . After that commit and push the changes to the remote repo.


1 Answers

Commit your work in progress and push it to a remote branch. When you're ready to merge it into your main branch you can use an interactive rebase to rewrite your history and eliminate "work in progress" commits.

like image 175
Jonah Avatar answered Sep 24 '22 20:09

Jonah