Having a bare repo is certainly one option. Some may find having two copies of a repo on one system to confusing.
Here's an alternate setup that doesn't use a bare repo. It does require some git hygiene/discipline though.
Setup:
Desktop:
git config --local receive.denyCurrentBranch updateInstead
This will let the laptop push the desktop, updating its files, as long as the desktop doesn't have uncommited things (aka working dir is clean).
On the laptop:
git remote add desktop...
Working with it:
Desktop:
commit everything
Laptop:
commit everything
git pull --rebase desktopgit push desktop (assuming there are no issues w/ the pull).
Not saying either workflow is better, merely providing
an alternative.
imo the reason git took over has some to do with being unopinionated about workflow - there's some tooling, but whatever workflow is managable with that tooling is "supported" - as long as the team can agree to use said workflow.
Here's an alternate setup that doesn't use a bare repo. It does require some git hygiene/discipline though.
Setup: Desktop: git config --local receive.denyCurrentBranch updateInstead This will let the laptop push the desktop, updating its files, as long as the desktop doesn't have uncommited things (aka working dir is clean). On the laptop: git remote add desktop...
Working with it: Desktop: commit everything Laptop: commit everything git pull --rebase desktop git push desktop (assuming there are no issues w/ the pull).
Not saying either workflow is better, merely providing an alternative.
imo the reason git took over has some to do with being unopinionated about workflow - there's some tooling, but whatever workflow is managable with that tooling is "supported" - as long as the team can agree to use said workflow.