Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Am I simply not getting git?

Am I simply not getting git?
Thread Tools
OreoCookie
Moderator
Join Date: May 2001
Location: Hilbert space
Status: Offline
Reply With Quote
Mar 9, 2009, 09:12 AM
 
I've recently switched from subversion to git to manage my drafts of papers (I rely on TeX). I switched to git, because it seems a lot easier to use and it's faster.
With subversion, I could easily check out earlier versions of the draft, after all, the repository was in a different location. git seems to `forget' earlier versions I have submitted when I check out earlier versions of my work.
Code:
bash > git log [gives full list of commits] bash > git checkout [hash of earlier copy] bash > git log [gives list up until the point of the checked out copy]
Am I missing something?

Are you supposed to clone your repository and only work on clones?
Is there a way to checkout a previous version of my work without destroying my history?
Or am I simply not using the correct command?
I don't suffer from insanity, I enjoy every minute of it.
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Mar 9, 2009, 05:28 PM
 
isn't each commit a new branch with git or something?

I haven't used git yet myself, but I'm intrigued by it. Keep us posted with how your transition to it goes, both conceptually and technologically
     
OreoCookie  (op)
Moderator
Join Date: May 2001
Location: Hilbert space
Status: Offline
Reply With Quote
Mar 9, 2009, 07:16 PM
 
The transition was really, really easy. Just compile git with svn support and you can import subversion repositories with a simple command line.

Branches are a lot more useful and much, much easier to use.
Code:
git branch [name of new branch]
Creates a new branch.
Code:
git checkout [name of branch]
switches to the newly created branch. That's it. You can change back and forth at will.

Plus, even though my LaTeX projects are comparatively tiny, subversion was not fast. git does everything `instantly.' Cloning takes as long as copying files (ok, perhaps a microsecond longer). Perhaps I'll ask the mailing list … 
I don't suffer from insanity, I enjoy every minute of it.
     
OreoCookie  (op)
Moderator
Join Date: May 2001
Location: Hilbert space
Status: Offline
Reply With Quote
Mar 9, 2009, 07:24 PM
 
I got it.
If you checkout an older version of your project (or file or whatever), git log will only show you `the past' (the parent nodes of the commit you've checked out). But at the same time, it creates a pseudo branch called `(no branch)' and you can go back to your old version by changing back to the master branch (git checkout master).

Quite simple, if you find it in the manual
I don't suffer from insanity, I enjoy every minute of it.
     
Big Mac
Clinically Insane
Join Date: Oct 2000
Location: Los Angeles
Status: Offline
Reply With Quote
Mar 10, 2009, 01:41 AM
 
I am so totally lost.

"The natural progress of things is for liberty to yield and government to gain ground." TJ
     
OreoCookie  (op)
Moderator
Join Date: May 2001
Location: Hilbert space
Status: Offline
Reply With Quote
Mar 10, 2009, 08:53 AM
 
git can be useful for the average user, too. It gives you revisions of your work and you can create `branches of your work' (similar to versions in Aperture, for instance). It's very useful if you work with a lot of text. Apple has a very good tool that marks differences in files in a visually unique way.
I don't suffer from insanity, I enjoy every minute of it.
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Mar 10, 2009, 02:25 PM
 
Oreo: can you walk me through how merges work? Merges are key for me, that's the primary reason I use Subversion (collaboratively)
     
OreoCookie  (op)
Moderator
Join Date: May 2001
Location: Hilbert space
Status: Offline
Reply With Quote
Mar 10, 2009, 06:50 PM
 
So I'm not an expert on this, but if you look at all the talks by the inventors, they claim merging is particularly simple. There is a rather simple explanation in this video (scroll to about minute 55-58, depending on where you want to start).

I would also recommend you simply try it out: convert your favorite subversion repository. There are more complex import procedures available if you have tags, etc. etc. From the wealth of documentation, it looks as if you can convert subversion repositories without losing anything. In my case, it worked just fine. You just need the users.txt file to associate user names used in subversion to names and e-mail addresses used in git. Branching really is trivial, literally just the push of a button.

You should definitely install fmdiff and convince git to use fmdiff (at least that's what I prefer), a wrapper which uses File Merge to look at conflicts. If you use TextMate, there are even two bundles for git, I think. Hope that helps.
I don't suffer from insanity, I enjoy every minute of it.
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Mar 10, 2009, 07:52 PM
 
Originally Posted by besson3c View Post
Oreo: can you walk me through how merges work? Merges are key for me, that's the primary reason I use Subversion (collaboratively)
Git's superior branching and merging are two of its key features.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 11:45 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,