Tag Archives: Version Control

SVN Command Line Basics

I keep forgetting SubVersion basics from the command line, and thought this quick little cheat sheet might come in handy. I’ll cover the basics:

  • checking out
  • updating your local copy
  • checking current file status
  • committing a change
  • adding a file
  • removing a file

Checkout Out

To make an initial copy of an online repository, we use the checkout command. It’ll create a new folder with the name of the online repo in the current directory and copy all its contents into it. Checkout can be abbreviated with co:

Updating your Local Copy

If you’ve already checkout out a repository, and you’re not sure if changes have been made on the remote, you can update your local copy using the update command. It can be abbreviated with up:

A list of updated files will be displayed, as well as the revision of the current commit. If no files are displayed, your local copy is up to date. Check svn help update for details.

Checking the status of current files

SVN let’s you display a status of all current files. This lets us decide what has been changed locally before a commit has been made. We use the status command for this, or its abbreviation stat:

A list of files and their status appears, or nothing if all files in your local copy match the online repository. Check svn help status for details.

Committing a change

When one or more files have been changed, it’s time to submit this change to the online repository. We do that with the commit command, abbreviated with ci (short for checkin). It’s customary to leave a small comment as to what this change does, using the -m switch:

Commit will store changes across multiple files. There’s no need to submit each file individually. The commit command is designed to make all changes final, such as updates, additions and deletions. It’s usually used at the end of all changes that have been make, as a final synchronisation step.

Adding a file

Add will add a new file to the repository. It’s necessary to add files to put them under version control, otherwise they’ll be designated with the ? parameter (as unknown state). The same goes for directories.

Removing a file

If you delete a file from the local directory, we must tell SVN about it. Otherwise it will assume the file still in the online repo is out of sync and should be downloaded to your local copy first (being obviously missing and all). Delete will remove a file for us. The command can be abbreviated with del, remove or rm:

Further Reading

How to embed images in GitHub Readme Files

In this screencast I’ll show you how to add images to your GitHub Readme files. You can use the Markdown or HTML syntax for this, I’ll show you both versions. Make sure to upload images to your own repository and provide the relative path to them.

Here’s the syntax:

In Markdown

In Markdown syntax, use the following example to embed an image:

In HTML

GitHub also supported the HTML syntax, which uses the standard IMG tag. Pasting HTML code in a website is always a little tricky, but let me try:

Should you have spaces in your file names, you can replace them with %20, just like in standard HTML (like “file%20name”).

Now go and make those Readme.md files look handsome!