In our lab, we are maintaining software and documents in CVS, Subversion, and GIT repositories. Often, I find myself looking up commands online for tasks like looking up a particular version of a file or dealing with conflicting versions. To save myself (and hopefully others) some time, I started a small table with equivalent commands for the different repositories.
|Show status of repository.||git status||svn status||cvs status|
|Add new <files> to repository.||git add <files>||cvs add <files>|
|Commit changes in existing <files> to repository.||git add -u <files> && git commit && git push||svn commit ||cvs commit
|Retrieve changes from repository.||git pull||svn update||cvs update|
|Show log of changes to <file>.||git log <file>||svn log <file>||cvs log <file>|
|Show changes in <commit> / <revision>.||git show <commit>||svn diff -c <revision>|
|Resolve conflicts in <files>||Fix conflicts in <files>. git add <files>||Choose "postpone" when conflict is found by svn update. Fix conflicts in <files>. svn resolve --accept=working <files>|
So far, I have only put a few commands that I remember from the top of my head. I haven’t double-checked them all, so using these commands is at your own risk. If you have any commands to add, feel free to leave a reply.