google code allows to use SVN to access the code and I was wondering whether there is way to access code with git.
$ git svn clone --username your-name -s https://your-project.googlecode.com/svn few other commands git log gitk git diff HEAD^^
git add filename git rm filename git commit -a => commits to local repository git push => sends to server repository
- Update – get online and check latest changes from google code
git svn rebase
- Export – sends commits to google code
git svn dcommit => sends commit
- Other useful commads:
git branch -a => shows all branches
You have noticed that svn command connected with git “git svn”. This is as already written google supports SVN, but git can comunicate “SVN” way 🙂
You can use “egit” plugin to connect your eclipse to git repository.
So summary time - equivalent svn/git commands - Git for SVN Usersvn checkout $SVNREP/trunk -> git svn clone $SVNREP -T trunk -b branches -t tags svn checkout $SVNREP/branches/release-0.3 -> git checkout -b local/release-0.3 release-0.3 svn commit -> git commit -a, or git add then git commit followed by git-svn dcommit svn diff|less, svn commit -> git commit -v svn merge -> git cherry-pick or use "gitk --all" svn status -> git status svn revert, --recursive -> git checkout , git checkout -f or git reset --hard svn diff -> git diff svn update -> git svn rebase --all (see also git stash)
I like to use SVN and specially their client for Win XP TortoiseSVN. But still didn’t use all the functionality which it gives. Here is very nice tutorial done by BEA.
Because I didn’t know what is the difference between tagging and branching here some thoughts I have found:
- you can name it as you want aka release_1.0
- it will take snapshot of all files and their revision number
- CVS will increase revision number for file(s) we are committing to repository, so we have to somehow keep information of all revision numbers of all files.
- SVN A tag is just a “snapshot” of a project in time. In Subversion, this idea already seems to be everywhere. Each repository revision is exactly that—a snapshot of the filesystem after each commit. Advantage of having tag command in SVN is that you can put name like release_1.1 instead of 673.
- when your software goes to production, tag it.
- then you continue programing. But during time, customer finds some bugs. So what to do ? Just checkout on to some other folder your code but with revision/tag name release_1.0. You will get your code which customer has and you can repair it, commit it back to your “release_1.0” revision and delivered the build to customer
- Next you will repair your code in your HEAD revision.
- Branches allows you to work on code which was already delivered
Tag – si zapamatuje jakou revizi maji konkretni soubory/adresare (takze pak nemusis mu rikat soubor po souboru ze chces soubor1 s revizi 1.2 a soubor2 s reziviz 1.5 atd..)
Branch – potrebujes opravit chybu ale ty mas uz svuj vyvoj zase dal a nemuzes ted udelat release protoze to mas cele rozdrbane. Tak si udelas branch na verzi kterou jsi si o tagoval “release1” (tenhle kod ma i zakaznik) a udelas opravu chyby. Pak muzes chybu MERGEnout do truncu nebo nechat opravu jen v branchi
Rozdil mezi CVS a SVN
Pri commitu v SVN se taguji vsechny soubory, kdezto v CVS ne. (Kdyz udelas commit v SVN tak se o taguji vsechny soubory i ty co nejsou zmenene). Z toho vyplyva ze SVN taguje automaticky.
CVS to explicitne prikazat aby o tagoval.