How do you use Git with multiple computers?

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.


Git has a concept of a "remote", such as a central server to push all of your code. You would push all of your changes to the remote (say from work), then when you get home, you can pull the commits you made from work.

GitHub is an excellent hosted Git solution that saves you the pain of having to set it up yourself. You can learn more about remotes, pushing, and pulling from ProGit.

As far as "incomplete" work, you could use a branch and push your branch to the remote. Branches allow you to create a "branch" of code off of the master (sometimes called a trunk). When you are done, you can merge all of the changes back to master. You can read more about branching here

Tags:

Git