Thread: A git flow for single-user development on multiple machines

  1. #16
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    laserlight: Thank you the link.

    I am now going to try a bare repo on my USB stick to solve this same problem.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  2. #17
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Ok. stahta01 motivated me into giving this another go. Here's how I am doing it. Please advise if I am doing something wrong, or I can simplify the process.

    At home computer (main development platform)
    1. I clone the project repo into a bare copy on the usb stick: $ git clone --bare [mycomputer_projectdir] [usb_dir]
    2. I add the usb to my remotes

    At my office computer and at my laptop (secondary development platforms)
    1. I clone the usb repo into a working tree repo
    2. I do normal work; branch (or not), merge (or not) and commit.
    3. I push work on the copy repo into the usb

    Back at home(primary development platform)
    1. I pull work done that day from the usb
    2. I do normal work; branch (or not), merge (or not) and commit.
    3. I push work on the copy repo into the usb

    Next day at the office or laptop (secondary development platforms)
    1. I pull from usb
    2. I do normal work; branch (or not), merge (or not) and commit.
    3. I push work on the copy repo into the usb

    repeat...
    Last edited by Mario F.; 02-18-2015 at 03:44 PM.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  3. #18
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    Quote Originally Posted by brewbuck View Post
    If it were my personal problem, I'd definitely leave the repo on the stick.
    Seconded. I don't know why Mario fears corruption. If you can't trust the drive for the centeral repo, I don't see how you could trust it any more for transferring updates among repos.

  4. #19
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by Yarin View Post
    Seconded. I don't know why Mario fears corruption. If you can't trust the drive for the centeral repo, I don't see how you could trust it any more for transferring updates among repos.
    Yeah. I ditched that thought soon after. I've had some problems in the past with usb sticks becoming corrupted out of nowhere and have been badly harmed in one particular incident. So I confess I'm a little paranoid when it comes to those things. But with a distributed system like git, it really there's nothing to fear about a corrupt usb stick.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  5. #20
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    No idea what is the right way this is what I am trying; I am a Git newbie of a several months (might be a year but, it not 2 years.)

    I run the commands in the Git folder on the hard drive.
    P: Is the flash drive letter.
    Code:
    git init --bare P:/CI_Git_Projects/DCRABBIT_9.62.git
    
    git remote add flashdrive P:/CI_Git_Projects/DCRABBIT_9.62.git
    
    git config --local push.default simple
    
    git push flashdrive
    It seems to work for me; but, I am not really using it to hold important data. I use Github like site for that.

    I am just storing the compiler binaries used to build in this flashdrive repo.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  6. #21
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    There are already four copies of the repo, how many more should we add? Another 15?
    O_o

    Did Mario F. say "I intend to visit each machine every update to synchronization the repository."?

    Nope. You are trying to say "three computers plus one stick".

    The reality is that only the current machine being used for active development has a current copy of the repository. When the live repository is synchronized with the stick, you have a single backup of the current data. You have one point of recovery should either the stick of the development machine fail. If two devices fail, you can't recover the data so you do not have two backups.

    *shrug*

    I don't consider an outdated branch to be a legitimate backup, but I guess you could pretend that you have four backups.

    Soma
    “Salem Was Wrong!” -- Pedant Necromancer
    “Four isn't random!” -- Gibbering Mouther

  7. #22
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by Mario F.
    Ok. stahta01 motivated me into giving this another go. Here's how I am doing it. Please advise if I am doing something wrong, or I can simplify the process.
    Looks fine by me. Since you're apparently the only developer, you don't have to worry about merge or rebase unless you say, fail to complete a unit of work such that you leave it uncommitted, then go elsewhere and do another unit of work that you push to the USB stick repo.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. ssh to multiple machines via c program?
    By purest in forum Linux Programming
    Replies: 6
    Last Post: 12-12-2006, 11:25 AM
  2. drawing flow-charts for every single program??
    By LogicError in forum A Brief History of Cprogramming.com
    Replies: 19
    Last Post: 05-30-2005, 10:22 AM
  3. Single API for multiple CGI
    By Unregistered in forum Linux Programming
    Replies: 1
    Last Post: 10-09-2001, 06:31 AM
  4. changing from multiple-doc to single-doc
    By swordfish in forum C++ Programming
    Replies: 2
    Last Post: 08-31-2001, 07:52 PM