I think I did the first commit on the git repository and also the last one on the subversion one :-)<br>-W<br><br><br><div class="gmail_quote">On 19 December 2010 21:30, Edson Tirelli <span dir="ltr"><<a href="mailto:ed.tirelli@gmail.com">ed.tirelli@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> All,<br>
<br>
Some comments on the document bellow as I was discussing with Geoffrey:<br>
<br>
* "git checkout" is actually the same as "svn switch", i.e., switching<br>
between branches in the same working directory... although git is so<br>
fast doing this you can't even compare with svn switch.<br>
<br>
* git has the concept of staging area. Because of that, when you do a<br>
commit, either you do "git commit -a" to commit everything, or you<br>
list the files you want to commit: "git commit <files_to_commit>". The<br>
git pro book explains this in detail and how to take advantage of the<br>
staging area with "git add".<br>
<br>
* be careful when using branches and rebase. The book also lists the<br>
golden rule for rebase:<br>
<br>
"Do not rebase commits that you have pushed to a public repository."<br>
<br>
* do not push personal branches to the reference repository. If you<br>
need to share a personal/development branch with someone, clone the<br>
repo into your github account and use that clone to make your<br>
personal/development branches public.<br>
<br>
I am also a beginner on git, but so far it has been working so much<br>
better for me and bringing so many features that I never imagined<br>
possible that I am very happy with the move. I strongly recommend, as<br>
Geoffrey mentioned before, that you read the "Pro Git" book... it is<br>
really good.<br>
<br>
Edson<br>
<br>
2010/12/19 Geoffrey De Smet <<a href="mailto:ge0ffrey.spam@gmail.com">ge0ffrey.spam@gmail.com</a>>:<br>
<div><div></div><div class="h5">> Purpose<br>
><br>
> This document shows you how to use Git, just as you were using SVN in the<br>
> past. It is to get you guys up and running with git as soon as possible by<br>
> relying on your SVN knowledge and it is focuses on what you want to do in<br>
> drools.<br>
> This document does not really teach you Git. Git is not just SVN++, it is<br>
> much more and you should take some time to learn that too.<br>
><br>
> Terminology<br>
><br>
> SVN trunk is renamed to Git master. A branch is still a branch. A tag is<br>
> still a tag.<br>
> Translation note: trunk == master<br>
><br>
> The SVN central repository is now the reference repository on github, see<br>
> https://github.com:droolsjbpm/droolsjbpm.<br>
><br>
> Part 1: Need to know<br>
><br>
> Preparation<br>
><br>
> If:<br>
><br>
> you’ve done the preparation in the dev list mail<br>
><br>
> and the correction too, skip to section Getting the source code locally.<br>
> haven’t done the correction yet, do this first (and the skip to that<br>
> section):<br>
><br>
> Step 4 stated:<br>
><br>
> $ git config --global <a href="http://user.name" target="_blank">user.name</a> myUsername // WRONG<br>
><br>
> Correct that by running:<br>
><br>
> $ git config --global <a href="http://user.name" target="_blank">user.name</a> "My Name"<br>
> $ git config --global -l<br>
><br>
> you haven’t done the preparation yet, do it now, as stated below.<br>
><br>
> Full preparation:<br>
><br>
> 1) Install git for your OS<br>
><br>
> 1a) Linux: Install the package git (and optionally gitk)<br>
><br>
> $ sudo apt-get install git<br>
> $ sudo apt-get install gitk<br>
><br>
> 1b) Windows: Use the icon on the right on <a href="http://git-scm.com" target="_blank">http://git-scm.com</a><br>
> 1c) Mac OSX: Use the icon on the right on <a href="http://git-scm.com" target="_blank">http://git-scm.com</a><br>
><br>
> Optionally install gitx from <a href="http://gitx.frim.nl/" target="_blank">http://gitx.frim.nl/</a><br>
><br>
> 2) Install git in your IDE<br>
><br>
> 2b) Eclipse: Install the EGit plugin.<br>
><br>
> Menu Help, menu item Install new software.<br>
> Work with update site Helios, open Tree item Collaboration, tree item<br>
> Eclipse EGit.<br>
><br>
> 2c) IntelliJ: Enable the git plugin (if not enabled):<br>
><br>
> Menu file, menu item Other Settings, menu item Configure plugins.<br>
><br>
> 3) Get a Github account: <a href="https://github.com/signup/free" target="_blank">https://github.com/signup/free</a><br>
> 4) Configure git correctly (Github also tells you this):<br>
><br>
> $ git --version<br>
> git version 1.7.1<br>
> $ git config --global <a href="http://user.name" target="_blank">user.name</a> "My Full Name"<br>
> $ git config --global user.email <a href="mailto:myAccount@gmail.com">myAccount@gmail.com</a><br>
> $ git config --global -l<br>
> <a href="http://user.name" target="_blank">user.name</a>=Geoffrey De Smet<br>
> user.email=ge0ffrey.spam@...<br>
><br>
> 6) Push your public key to github:<br>
><br>
> Follow the instructions on <a href="http://github.com/guides/providing-your-ssh-key" target="_blank">http://github.com/guides/providing-your-ssh-key</a><br>
><br>
> Getting the source code locally<br>
><br>
> First move your old SVN working directory aside, so you’re not confused that<br>
> you shouldn’t work there any more:<br>
> $ cd projects<br>
> $ mv drools drools-oldsvn<br>
><br>
> Now you’re ready to get the sources with git. In SVN this is a svn checkout,<br>
> but in Git this is called a git clone. Prefer the faster, stabler git<br>
> protocol over the slower https protocol:<br>
> $ git clone git@github.com:droolsjbpm/droolsjbpm.git droolsjbpm<br>
> Next go into that directory<br>
> $ cd droolsjbpm<br>
><br>
> So what’s the command git checkout for? To switch to another branch, but in<br>
> the same working directory. In SVN you also use svn checkout for that.<br>
> Translation note: svn checkout == git clone (new repository) OR git checkout<br>
> (change branch)<br>
><br>
> Follow the instructions in the README.txt to set up your Eclipse or IntelliJ<br>
> again.<br>
><br>
> Getting changes from others<br>
><br>
> So Mark and Edson changed something in drools-core in the reference<br>
> repository. How do I get those changes? In SVN this is svn update, but in<br>
> Git this is a git pull.<br>
> $ git pull<br>
> Translation note: svn update == git pull<br>
><br>
> Making changes<br>
><br>
> While making your changes, do the same as in SVN: git add, git rm (instead<br>
> of svn delete), git status.<br>
> Translation note: svn delete = git rm<br>
><br>
> After making your changes, you ‘ll want to do a git commit (when you’re done<br>
> with a changeset) and a git push (to share those changes with the rest of<br>
> the team). To recap: doing a git commit does not push your changes to the<br>
> remote repository yet, you also need to do a git push.<br>
> $ git commit -m “JBRULES-123 fix testcase”<br>
> $ git push<br>
> Translation note: svn commit == git commit + git push<br>
><br>
> Part 2: Tell me more<br>
><br>
> Extra terminology<br>
><br>
> What is rebasing? A rebase is an alternative manner of merging: instead of<br>
> merging your changes with the incoming changes, it takes the incoming<br>
> changes and applies your changes on top of that. For example:<br>
> $ git pull --rebase<br>
><br>
> What is origin? Because git can work with multiple remote repositories<br>
> (usually forks of the same project), the default remote repository is known<br>
> as origin. If you’ve cloned the reference repository, then origin is the<br>
> reference repository. If you’ve forked the reference repository as A and<br>
> cloned A, then origin is A.<br>
><br>
> Branching<br>
><br>
> Usually we’ll have 2 types of branches: release branches and topic branches.<br>
> To switch to another branch, just use git checkout:<br>
> $ git checkout 5.1.x<br>
><br>
> To create a branch do:<br>
> $ git checkout -b 5.2.x<br>
><br>
> Release branching<br>
><br>
> A release branches is copied from the master branch and only receives<br>
> bug-fixes. It is separated from the master branch so no unstable features or<br>
> improvements (pushed by other developers) leak in.<br>
> For example: $ git checkout 5.1.x<br>
><br>
> Cherry picking is very interesting to pick bug-fixes from the master branch<br>
> into the release branch.<br>
><br>
> Topic branching<br>
><br>
> A topic branch is copied from the master branch and is eventually merged<br>
> back into the master branch. Its changes are to disruptive to other team<br>
> members to be committed to the master immediately.<br>
> For example: $ git checkout trueModify<br>
><br>
> Rebasing is very interesting when you’re working on an experimental feature<br>
> in a topic branch for the last few weeks and you want to have the latest<br>
> changes of master(=trunk) in there too (= sync up with master):<br>
> // on my the myTopic branch<br>
> $ git rebase master<br>
><br>
> After your topic branch is stable, you’ll merge it into the master branch:<br>
> $ git checkout master<br>
> $ git merge trueModify<br>
><br>
> Learn more<br>
><br>
> Do you want to really learn Git?<br>
> Read the Pro Git book (freely available online): <a href="http://progit.org/book/" target="_blank">http://progit.org/book/</a><br>
> You’ll easily gain the time you spend reading that book, because Git is more<br>
> than SVN++.<br>
> Read that book, especially if you’re going to do branching and merging!<br>
> Other references: Hibernate git tricks, SVN crash course, Git for Gnome<br>
> developers, ...<br>
><br>
> --<br>
> With kind regards,<br>
> Geoffrey De Smet<br>
><br>
</div></div>> _______________________________________________<br>
> rules-dev mailing list<br>
> <a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
><br>
><br>
<br>
<br>
<br>
--<br>
Edson Tirelli<br>
JBoss Drools Core Development<br>
JBoss by Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
<br>
_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
</blockquote></div><br>