VersionControl

Chair for Computer Aided Medical Procedures & Augmented Reality
Lehrstuhl für Informatikanwendungen in der Medizin & Augmented Reality

Version control

Version control, also known as revision control and source control, is the management of changes to documents, computer programs, large web sites, and other collections of information. Changes are usually identified by a number or letter code, termed the "revision number", "revision level", or simply "revision". For example, an initial set of files is "revision 1". When the first change is made, the resulting set is "revision 2", and so on. Each revision is associated with a timestamp and the person making the change. Revisions can be compared, restored, and with some types of files, merged. For more information see Revision control.

Git

Software

Manual

Git @ CAMP

  • We USED TO run a Git Lab instance to manage repositories and users
  • That was deprecated in favor of the LRZ GitLab

Cheat Sheet (Command line)

Add file to staging area:
git add <filename>

Add all in current dir/subdir to staging area (does not stage delete-changes, use -u for that, see below):
git add .

After renaming a folder all the "new" files were unstaged while the "old" appeared as deleted. Staging with “git add .” doesn't work here. What works is:
git add -u

Shortcut for 'git add . ; git add -u':
git add -A

Commit staged changes and put message directly on command line:
git commit -m "My commit message"

Shortcut to add all changes (of already tracked files!!) to staging area and do commit:
git commit -am "My commit message"
(does not work for untracked files! Need to run 'git add -...' for that...!)

List branches:
git branch

Switch branch:
git checkout <branch to switch to>

Create and switch to new (local) branch:
git branch <new branch>
git checkout <new branch>

Create branch (locally) and switch to new branch in one command:
git checkout -b <newbranch>

Delete local branch:
git branch -d <tobedeletedbranch>

Delete remote branch:
git push origin:<tobedeletedbranch>

Push new branch to remote repository:
git push –u origin <new branch>

Merge branch into current branch:
git merge <branch to be merged into current branch>

Show ignored files:
git ls-files –others –i exclude-standard

Get remote branch from someone ( = create new local branch with remote branch as starting point):
git fetch origin
git checkout --track origin/<bname>

or (difference?)

git checkout -b <bname> origin/<bname>
(syntax: 'git checkout -b <new name> <starting point> )

List Git configuration
git config --list



Subversion

ALERT! Subversion is deprecated, new projects should be hosted on GitLab!

Software

Manual

Guidelines

  • Do not check in code that cannot compile!
  • Ensure that you check out src and 3rdParty on the same level, since all links and includes are relative.
  • A detailed decription of SVN policies can be found in the SVN (\src\guidelines\).

HTTPS access to the Repositories

the HTTPS address is as follows:

https://camplinux.in.tum.de/svn/$REPOSITORY/trunk

You need your domain credentials to login.

Some available repositories

  • svn (access for everyone involved with CAMP)
    • 3rdparty
    • matlab
    • camplib

  • campintern (access only for the camp staff)
    • teaching
    • papers
    • thesis
    • etc...

  • studwork (access for everyone involved with CAMP)
    • Repository for SEPs, ...

The most important URLs

  • Publications
    • https://camplinux.in.tum.de/svn/svn/trunk/doc/onlineCollaboration/papers
    • https://camplinux.in.tum.de/svn/campintern/trunk/theses

  • Code
    • Matlab: https://camplinux.in.tum.de/svn/svn/trunk/matlab
    • Camp Libs: https://camplinux.in.tum.de/svn/svn/trunk/src/libs
    • Camp Apps: https://camplinux.in.tum.de/svn/svn/trunk/src/apps

  • General Documents
    • https://camplinux.in.tum.de/svn/svn/trunk/doc

FAQ

  • Q: What if I don't want to checkout the entire repository?
  • A: Just add the folder in the repository you want to your address string. For example if you want just the /src folder from a repository:
    • https://camplinux.in.tum.de/svn/svn/trunk/src

  • Q: I get an error code 403 - Forbidden.
  • A: You don't have access to the repository. If you're sure, that it should be otherwise, contact the admins.

  • Q: A folder in the repository, of which I am sure that it exists, wasn't checked out. Why?
  • A: Some repositories have restricted subfolders. These folders will be ignored when you do a full checkout.

  • Q: I forgot my password. Who can I contact?
  • A: Contact the admins to get a password reset.

  • Q: I want to have a new repository. Can I create it myself?
  • A: No, only members of the admin group can create repositories and edit groups. Please contact the admins in case you need a new repository or need modifications in the accessibility.

  • Q: My SVN update stops unexpectedly with the error message: svn: Can't recode string What happened?
  • A: Somebody checked in a file with strange characters in its name; try to do export LANG=en_US or any other locale that can represent the particular character.



Edit | Attach | Refresh | Diffs | More | Revision r1.12 - 27 Sep 2016 - 08:44 - MarcoEsposito

Lehrstuhl für Computer Aided Medical Procedures & Augmented Reality    rss.gif