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> |
Legend:
- <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