Results 1 to 11 of 11

Thread: [RESOLVED] git question

  1. #1

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    Driving a 2018 Mustang GT down Route 8
    Posts
    4,475

    Resolved [RESOLVED] git question

    We are using git as our source code control system. (I am from a SourceSafe background; years and years of it). I had some free time the other day and started to read a git tutorial so I would understand better how to use it. There is one thing I completely don't understand. I have a version of a source file right now that works but I want to analyze it and make it better. I want to put the current version in a safe place. If I commit the file, it only goes to my local repository? If I push it, then it's available for the whole team to see and they would pull it down if they were refreshing the project it belongs to? Is there a happy medium between these two places? I want a backup copy of it that's safer than just local, but I really don't want to give it to anyone else until I clean it up and it's perfect.

    I'm thinking just copy it to a network drive but what I read the other day is that git gives you options so you don't have to do that. But if the option is a Push, no thanks; I'll make a copy of it.
    There are 10 kinds of people in this world. Those who understand binary, and those who don't.

  2. #2
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    Re: git question

    So just commit it, don't push it. There is no medium... it's either going to be local or in the central server. It's not really all that different form TFS/SourceSafe, it's in one spot or the other.

    Until you push it, no one else if going to be able to get the changes. Meanwhile you can make all the changes you want to it.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    Driving a 2018 Mustang GT down Route 8
    Posts
    4,475

    Re: git question

    Right, I guess it's not all that different. For some reason I feel I shouldn't push anything that isn't stellar, that I don't want everyone to have - even though you're right that a check-in in TFS is the same.

    Bottom line: if I *don't* push it, I do run the risk of losing it if my hard drive crashes?
    There are 10 kinds of people in this world. Those who understand binary, and those who don't.

  4. #4
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    Re: git question

    Sure... but that's always an issue... the only way to avoid that is to do all development off drive, in the cloud somewhere. If your system is prone to crashes, then you might want to take extra steps to protect the code. A while back I had a laptop that crashed on an almost reliable basis (I timed it one day, it was crashing every 70 minutes, 8, 9:10, 10:20, 11:30... ) so I bought an external USB hard drive, started using that as my code storage. When the laptop finally went and wasn't coming back, I still had the code, with changes in progress, since it was all on the external drive.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    Driving a 2018 Mustang GT down Route 8
    Posts
    4,475

    Re: git question

    I have no idea if my system is prone to crashes. I've been here a month. But I don't know that it isn't prone to crashes, so I am being careful ! Thanks for the replies.

    (Every 70 minutes. That is crazy!)
    There are 10 kinds of people in this world. Those who understand binary, and those who don't.

  6. #6

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    Driving a 2018 Mustang GT down Route 8
    Posts
    4,475

    Re: git question

    I have no idea if my system is prone to crashes. I've been here a month. But I don't know that it isn't prone to crashes, so I am being careful ! Thanks for the replies.

    (Every 70 minutes. That is crazy!)
    There are 10 kinds of people in this world. Those who understand binary, and those who don't.

  7. #7

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    Driving a 2018 Mustang GT down Route 8
    Posts
    4,475

    Re: git question

    Hmmm, the forum said if I leave this page my changes will be lost, but instead of being lost they were duplicated. Sorry for repeating myself!
    There are 10 kinds of people in this world. Those who understand binary, and those who don't.

  8. #8
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,900

    Re: [RESOLVED] git question

    I don't know GIT (I've used SourceSafe, TFS and SVN) but usually you'd create a branch for something like this. That way you can make your changes along the branch without affecting the main trunk the other devs are working off and then, when you're happy, merge it back into trunk (or possibly trunk into branch depending on how you prefer to work). This gives you all the benefits of safe storage, ability to roll back etc, without affecting the other devs until your ready.

    Does GIT support branching?
    The best argument against democracy is a five minute conversation with the average voter - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

  9. #9
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,660

    Re: [RESOLVED] git question

    Does GIT support branching?
    Yes of course it does
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  10. #10
    Fanatic Member
    Join Date
    Aug 2013
    Posts
    806

    Re: [RESOLVED] git question

    Hi MMock. Techgnome has already provided great advice, but I just wanted to add "git stash" as an option to consider. Stashes were designed for exactly the use-case you describe. They are a special type of commit designed for local "stashing" of work that you may or may not decide to use in the future.

    Here is a good link for understanding the difference between stashing and branching in Git:

    http://stackoverflow.com/questions/3...-vs-git-branch

    ...and another for understanding the difference between stashing and committing in Git:

    http://stackoverflow.com/questions/1...-local-changes
    Check out PhotoDemon, a pro-grade photo editor written completely in VB6. (Full source available at GitHub.)

  11. #11

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    Driving a 2018 Mustang GT down Route 8
    Posts
    4,475

    Re: [RESOLVED] git question

    Thanks. I will definitely take a look at those links.
    There are 10 kinds of people in this world. Those who understand binary, and those who don't.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width