[opensuse-buildservice] The move to git: what changes for you
Hi, The build service is in git now and while svn was simply and easy, git is powerful and more complex. The good news is that the things most of you do are easy with git too. If you head to the power usages, you might need more documentation than this mail. So let me first summarize the basic ideas in svn and git: SVN has one central server and only admins have access to the repository, developers need to access it through a client for almost everything. This includes creating diffs, checking out branches, creating branches, ... SVN also has no specific concept about branches, everything in there are directories, you copy away trunk into another directory (common practise is a subdirectory below /branches, but that's just convention) and then you need to track patches between trunk and the branches your own. There are tools to help with that though. The working copy is a 1:1 representation of one directory of the SVN server. You either have uncommited changes or they are on the server too. GIT has no central server, everyone has full access to the repository and the clients will mainly only exchange their changes. Of course you can put these repositories on servers so it's easier for exchange between several people - that's what gitorious.org (and many others provide). All other actions are done in the local repository of the single developer, you create diffs, checkout branches, commit, create branches, merge branches - all in _your_ repository. Unless you decide to "push" these changes into another repository or "pull" from another repository it's all for yourself. The working copy always contains the full repository (you can limit the download to certain branches and history depth though). So there is a fundamental difference between these two that _is_ a cultural shock - no doubt. But this cultural difference is basically what the whole openSUSE project is all about: SVN is "group of people develops on their server", GIT is "everyone is free to join, no-one has more rights than the other to develop". (You might disagree and I'm oversimplifying) Of course the repository on gitorious.org is protected and not everyone can push to _that_ repository directly without review. But with svn you have to collect patches on your own and keep sending them, with git(orious) you can clone the build-service repository, develop on your own annotating every change you did (keeping track on your own development history) and once you're satisfied you push it as "merge request". This is _very_ similiar to what you do with osc and devel branches. So this should not be new to you. So how do you start? Let me take osc as an example. Checkout: git clone git://gitorious.org/opensuse/osc.git cd osc ./osc-wrapper.py -h Update: git pull Commit to your repository: git commit -a # -a for all files Upload your changes: git push Show the last commit: git show HEAD Show all branches: coolo@desdemona#osc>git branch -a * master remotes/origin/HEAD -> origin/master remotes/origin/jw remotes/origin/master Checkout a branch: # note that this is all locally, no server contacted git checkout -t origin/jw Merge another branch (the short way): git merge origin/master Merge another branch (the long way): coolo@desdemona#osc>git merge origin/jw Auto-merging NEWS CONFLICT (content): Merge conflict in NEWS coolo@desdemona#osc>eclipse NEWS coolo@desdemona#osc>git diff NEWS # see diffs against merge point coolo@desdemona#osc>git add NEWS # mark as resolved coolo@desdemona#osc>git commit # commit manual merge Note the "origin", every remote repository has a name. There can be more than one. As you can clone repositories, you can also register more than one repository "clone" and then merge the changes locally in your repository and push it to a 3rd repository - as I said in the beginning: git is powerful and complex. So my suggestion would be: start with simple things and get used to the commands. You can also clone the repositories on gitorious and play around as much as you like in those clones - they can be discarded in a second if something went wrong :) Greetings, Stephan -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Hey, Le vendredi 04 décembre 2009, à 11:03 +0100, Stephan Kulow a écrit :
Hi,
The build service is in git now and while svn was simply and easy, git is powerful and more complex. The good news is that the things most of you do are easy with git too. If you head to the power usages, you might need more documentation than this mail.
When GNOME moved to git, a lot of people were a bit scared of the change, especially since they had the feeling the git documentation was a bit rough (but this is getting better). So we have some quite readable and understandable documentation at: http://live.gnome.org/Git Nearly all of this should apply to gitorious too. The most useful subpages are: http://live.gnome.org/Git/Developers http://live.gnome.org/Git/FAQ http://live.gnome.org/Git/Tips Cheers, Vincent -- Les gens heureux ne sont pas pressés. -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Just to follow up on this. All existing contributors, who send me already their gitorious account name have now push rights to our repositories. The setup of the server is now a bit different. I started to document this here: http://en.opensuse.org/Build_Service/Run_from_git However, this page is not finished. Since I have no time to continue on that one today (and most likely next days), it would be great if someone, who set up a server before could continue on that pages. One thing what I want to stress here is that we should think about where we develop something, since the git concept is different. Even when I have push rights, I might clone something into my private repository to be able to push intermediate submissions there. So I can even clean up my history late (if needed) before I push something to our main repository. As a result, we do not want to see experimental or private branches in our main repositories as before with svn. Please use your own repository on gitorious for this. Also, you might not push something directly (even if you have the rights), but create a merge request. This is similar to the submit request concept of the OBS, someone else will review it and accept/decline it. It is obvious that everybody who has not yet worked with git will run into some trouble somewhere. So please be not shy and ask for support here or on IRC. I hope all these changes will turn out to be valuable for us in some month. have a lot of fun :) adrian PS: What we did was manually modifing the svn dump with a large number of filter rules, changing with regular expression and additional hand written commits in the history. It might be that we messed something up, but everything looked good to us so far. Nevertheless, please speak up, if you think you see some inconsistency. -- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Stephan Kulow wrote:
[...] Checkout: git clone git://gitorious.org/opensuse/osc.git cd osc ./osc-wrapper.py -h
Update: git pull
In most cases it's probably better to use "git pull --rebase". This way useless merges are avoided if you have local commits. Merges are really only needed if you've published your changes elsewhere already. cu Ludwig -- (o_ Ludwig Nussel //\ V_/_ http://www.suse.de/ SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
participants (4)
-
Adrian Schröter
-
Ludwig Nussel
-
Stephan Kulow
-
Vincent Untz