Practice: Two Computers
Laptop and desktop in sync.
GitHub isn't only for teams. It's also the easiest way to keep your own work in sync across two computers. Say a laptop and a desktop. The rule is simple. Pull when you sit down, push when you get up.

- Not only for teams
- Your laptop and your desktop
- Pull when you sit down, push when you leave
On the laptop
On the laptop, we finish some work in a café. Commit it, and push it before closing the lid.
echo '<p>Written in a cafe</p>' >> index.html git commit -am "Add cafe note" [main 4367a51] Add cafe note 1 file changed, 1 insertion(+) git push To https://github.com/sam/my-site.git f63a17a..4367a51 main -> main
On the desktop
Back home, on the desktop, which cloned the same repository last week. First thing, git pull. The café work arrives. We carry on exactly where we left off.
git pull From https://github.com/sam/my-site f63a17a..71f58ce main -> origin/main Updating f63a17a..71f58ce Fast-forward index.html | 1 + 1 file changed, 1 insertion(+) tail -1 index.html <p>Written in a cafe</p>
Forgot to push?
Forgot to push from the laptop? Then the desktop simply doesn't have that work yet. Nothing is lost, it's waiting on the laptop. And if you made changes on both, git pull merges them, just like with a teammate. Pull first, push last, and it just works.
Summary
Pull when you start, push when you stop, and GitHub keeps all your computers in sync. Next, the heart of teamwork on GitHub. Pull requests.
Key takeaways- Pull when you start
- Push when you stop
- Nothing is lost