Working with git from 2 laptops with no bare repo

前端 未结 4 2036
长发绾君心
长发绾君心 2021-01-06 11:26

I\'ve started project in my first laptop. git init, and start working. Tomorrow i\'m going to vacations. I want to take with me my smaller laptop.

And work with pro

4条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-06 12:20

    Adding to mkarasek and 5ound ....

    If this is a situation you encounter regularly, a good idea would be to keep bare repos on your small laptop and push/pull from that regularly using the ssh protocol.

    Pushing/Pulling from repos with a working branch checked out can easily lead to conflicts and management headaches.

    Keeping a copy of a bare repo on your small laptop (assumed authoritative) will give you the flexibility to push to it using the file:// protocol when you're not at home. When you return home and have the small laptop on your LAN, simply do a git pull using the ssh protocol.

提交回复
热议问题