Changes for page Getting Started with Git

Last modified by Bastian Triller on 2013/05/21 17:24

From version 171.1
edited by Ray Kiddy
on 2011/07/04 19:09
Change comment: added some "unique concept" bits
To version 175.1
edited by Ray Kiddy
on 2011/07/25 00:50
Change comment: git annoyances. are there any? yes, there are.

Summary

Details

Page properties
Content
... ... @@ -109,7 +109,7 @@
109 109  
110 110  === Versions? or Diffs? ===
111 111  
112 -One satori that I had while speaking to my git guru (thanks, Kieran!) is this. Subversion is all about versions. CVS was all about versions. We have been working with these a long time and the ideas are sticky. Git is //not// about versions. It is about diffs. Diffs are the main thing. If you think about it, this makes sense. You have thoughts and make changes and those diffs are the product of your work. If you get those diffs into something, that is good, but the work product was the diffs.
112 +One satori that I had while speaking to my git guru (thanks, Kieran) is this. Subversion is all about versions. CVS was all about versions. We have been working with these a long time and the ideas are sticky. Git is //not// about versions. It is about diffs. Diffs are the main thing. If you think about it, this makes sense. You have thoughts and make changes and those diffs are the product of your work. If you get those diffs into something, that is good, but the work product was the diffs.
113 113  
114 114  All this rebasing and such may seem odd. But the main thing is the diffs. I have edits from a two-week old repository. What do I do? I move the diffs so that they are diffs from the latest code. That is a rebase. When we make edits, we are used to being over-concerned about merge conflicts. But they do not happen all that often and are actually easy to deal with when they do, if the tools are oriented to making them easy to deal with. If we are worrying about the versions and not the diffs, we are paying attention to the paper we write on and not to the words we are putting down.
115 115  
... ... @@ -122,3 +122,13 @@
122 122  Might you end up with too many branches? Perhaps. How messy is your desk? If you are a clean-desk person, you will probably not have too many branches. You will organize and combine your branches. You will rebase your branches. You may delete your branches. After all, you had the thought. You can write the code again. If it is too distracting to keep the branch relevant, tuck the thought into the back of your head, delete the branch, let it go and move on. If you are a messy-desk person, you will probably have lots of branches. It would probably be a good thing to clean up, merge and rebase your branches before you try to share your changes. But that is obvious. Nobody wants to see how messy your desk is.
123 123  
124 124  Keep in mind that the difficult part of what you do should be the thinking. Git makes it easy to organize and share your thoughts as branches. Your local copies may be messy or not. They are the thoughts you have in your head and lots of those thoughts will stay there and never see the light of day and that is ok. But when you have clarified your thoughts, git will make it easy to share them.
125 +
126 += Git Annoyances =
127 +
128 +=== How to revert? ===
129 +
130 +Reverting seems really complicated. Perhaps the simplicity of "svn revert" has fooled me. For example, say that a bunch of files get changed under you (such as, when eclipse helpfully changes the encoding specified for all the .woo files in a project without saying a word about it), how can you revert them. You might think "git revert" would work, but (if I understand it) that is only for reverting a checkin. Delete the file and do a revert? Nope. I know, svn will do just fine there, but not git. In order to do this, you need:
131 +
132 +> ##git ls-files --d | xargs git checkout --##
133 +>\\
134 +>>Isn't that intuitive?