-
Oct 30th, 2014, 09:32 AM
#1
Thread Starter
PowerPoster
[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.
-
Oct 30th, 2014, 10:53 AM
#2
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
-
Oct 30th, 2014, 10:56 AM
#3
Thread Starter
PowerPoster
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.
-
Oct 30th, 2014, 11:09 AM
#4
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
-
Oct 30th, 2014, 11:28 AM
#5
Thread Starter
PowerPoster
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.
-
Oct 30th, 2014, 11:29 AM
#6
Thread Starter
PowerPoster
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.
-
Oct 30th, 2014, 11:30 AM
#7
Thread Starter
PowerPoster
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.
-
Oct 31st, 2014, 05:01 AM
#8
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
-
Oct 31st, 2014, 05:13 AM
#9
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
-
Oct 31st, 2014, 10:01 AM
#10
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
-
Oct 31st, 2014, 10:05 AM
#11
Thread Starter
PowerPoster
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|