Working with git from 2 laptops with no bare repo

前端 未结 4 2066
长发绾君心
长发绾君心 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:21

    Don't use push; when you get back, add your travel laptop repository as a remote in the repo on your other laptop, and pull the changes.

    From the manual:

    Note that the target of a "push" is normally a bare repository. You can also push to a repository that has a checked-out working tree, but the working tree will not be updated by the push. This may lead to unexpected results if the branch you push to is the currently checked-out branch!

提交回复
热议问题