It looks like Developerworks (https://www.ibm.com/developerworks) updated their theme and one of my old post is no longer usable. So I thought I would repost it in my new blog.
A while back I came across a Nick Boldt article called ” Git vs. SVN – Basic Commandline Syntax Reference.” I decided to enhance his table to include Syntax for the Rational Team Concert Command-line client.
|Action||Git Syntax||Subversion Syntax||Rational Team Concert Synta|
|Initial checkout from existing repo for a given branch||git clone <url> ;cd <module>;git checkout <branch>||SVN checkout <url>/<branch>||lscm load -r <url>|
|Update locally checked out files from central repo||git pull||svn update||lscm accept -v|
|List locally changes files/folders||git status||svn stat||lscm status|
|Diff locally changed file||git diff somefile.txt||svn diff somefile.txt||lscm diff file somefile.txt|
|Revert locally changed file*||git checkout somefile.txt||svn revert somefile.txt||lscm undo somefile.txt|
|Revert ALL local changes (except untracked files)*||git reset –hard HEAD||svn revert . -R||lscm load <workspace> -r <url>|
|Add new file||git add file.txt||svn add file.txt||lscm checkin file.txt|
|Add new folder recursively||git add folder||svn add folder||lscm checkin folder|
|Delete file||git rm file.txt||svn rm file.txt||rm file.txtlscm checkin <parent folder>|
|Delete folder||git rm -r folder (non-recursive by default; use -r to recurse)||svn rm folder (recursive by default; use -N to not recurse)||rm folderlscm checkin <parent folder>|
|Commit changed file to central repo||git commit -m “<message>” file.txt; git push||svn ci -m “<message>” file.txt||lscm checkin file.txtlscm changeset comment <changeset> <message>|
- <URL> – Repository URL
- <branch> – Branch or Stream or workspace
- <module>.- the component of the repository.
- <workspace> – Workspace is the Rational Team Concert equivalent of private Stream.
- <changeset> – Alias or UUID of target change set.
- <message> – Comment Text
3 thoughts on “Git Versus Subversion Versus Rational Team Concert – Basic Commandline Syntax Reference”
For committing a file to the central repo in RTC, don’t you also need a deliver command?
I left it out since the deliver command for each is almost comparing apples to oranges. This is where RTC source control, GIT, and SVN comparisons get a little bit fuzzy. In RTC users are encouraged (not required) to work in a repository workspace which is essentially a private stream. You can work directly out of a shared stream via the web interface and check-in without delivering. Delivering is meant for moving between streams. GIT is unique since almost everything is a private stream. Pushing between streams to a shared stream is almost outside the core functionality (see git-deliver). SVN on the other hand is more traditional “old-school” source control.
I have used RTC’s SCM on three different projects and while I understand the goal was to do an apples to apples comparison, I have to say that by leveraging the stream/workspace capability is a HUGE HUGE HUGE advantage. In this scenario, a stream equates to a branch.
When using RTC repository workspaces, you now have the flexibility that each developer can have their own workspace (essentially a snapshot of the stream at some point in time). They can develop independently, accept change sets from the stream at their choosing, conduct code reviews from their workspace BEFORE delivering the change sets to the stream, etc. You can use separate workspaces for the purpose of continuous integration, nightly, and various flavors of driver/release builds too.
It’s extremely powerful and offers a great amount of flexibility. This approach also offers a lot more latitude to the development team.