Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
531 views
in Technique[技术] by (71.8m points)

version control - Using GIT on USB stick for "travelling code"

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 I need to get some clarification, and assistance.

What I am doing is working on a side-project for work both at my office and at home. (I'm migrating C# code to Java to help me learn both languages.)

The setup:

  • Environment: Windows 7 (VS 2008 is on an XP virtual machine)
  • Git: msysgit 1.7.4
  • IDEs: VS 2008 and Eclipse
  • Git plugins:
    • Eclipse: I am using EGit.
    • VS 2008: I plan on using one mentioned here on SO, Git Extensions
  • Git repository: Located in Repo on the USB stick - right now it just has a portion of the Java code as I fumble my way through learning Git.
  • C# code in a Virtual Machine with VS 2008 that gets copied out of the VM to the USB stick - this is not under version control, yet.
  • And yes, I have backup copies of all code for the "baseline". I had to since EGit, when you put the code under source control, moves it from my Eclipse workspace into the git repository on the USB drive. So if something goes crazy while learning, I can easily recover. I have not made major changes yet to the code, since I am still learning.

Note: Using Github is not an option.

Purpose/Goal:

What I am trying to do is keep the code as much in order, with version control, as possible by using Git, but in setting it up at work, for some reason I'm a bit afraid it won't work the same when I get home. (Side note: I sense a "This is of the beauty of git." type answer somewhere.)

My questions are:

  • Using Git as a version control system, what is a best practice for this type of setup?
    • Should I leave it on the USB stick just use that repository for everything?

Sorry for the length, but I wanted to provide as much information as possible. Thanks ahead of time for any information anyone can provide after wading through my novel.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...