Using GIT on USB stick for “travelling code”

前端 未结 5 1754
野趣味
野趣味 2020-12-03 07:36

I have exhaustively searched for answers to my question here and on Google. I have found some great resources and learning tools for understanding Git and what it does, but

相关标签:
5条回答
  • 2020-12-03 08:01

    Using the USB stick to keep the code and the repository on is one option - you get the advantages of portability and version control.

    But, another way to do this is to keep a bare repo on the USB stick (or dropbox) and on each machine that you want to use the code, make a clone of this. When you finish doing what you are doing you can just push your changes upstream (to the USB stick or Dropbox or wherever).

    Having a bare clone portable means that if you forget (or $DEITY forbid) lose the stick in it's travels, you won't be left holding your…without any code to work on. You can recreate a clone from any of the repositories if you've lost the key, and, if you forget the key at home or work or somewhere else, there is always something you can do on your project and merge the changes with the key when next they are together.

    0 讨论(0)
  • 2020-12-03 08:02

    Try keeping a bare repo on the usb stick and clone it to the machines you are working on.

    Before you pack up for the day or complete to remove your stick, push your changes back to the "origin" (which is the bare repo on the stick).

    When you open up on your other workstation (home?) fetch your changes.

    0 讨论(0)
  • 2020-12-03 08:05

    Another way is via bundles. This assumes you are using an independent machine, see how-to-use-git-in-a-sneakernet-environment

    0 讨论(0)
  • 2020-12-03 08:06

    One common solution is to keep a bare repo in dropbox and push/pull with that to keep your computers in sync.

    0 讨论(0)
  • 2020-12-03 08:21

    Just a suggestion:

    I use Truecrypt with my USB sticks. My code goes into a tc volume. In case I lose the stick - which is fairly common with those things - the finder doesn't get my code.

    0 讨论(0)
提交回复
热议问题