Bars cli commands are based on common vcs tools like git or hg. So if you familiar with such tools, you already know all the major commands to work with.

So the worksteps are that you either create a new repostitory or clone an existing remote one. After that you would checkout certain revisions, commit files. You would from time to time synchronise your local repository with push and pull commands.

Create new Repository

You probably start by creating a new repository where you would then add files. Therefore create a new directory, dir into that directory and execute the init command:

  mkdir mytestrepo
  cd mytestrepo
  bar init

After that you are now able to add files and work with the rest of the bar commands.

Clone Repository

If you already have a remote repository and want to clone it to your local machine you can do so by:

  bar clone ssh://user@machine//path/to/repo localdir

When the command finishes, you have a clone on your local drive where you can continue to work with.

List Heads, List revisions

You can list all heads of the repository.

  bar heads

Normally you get here only one snapshot. You could have multiple heads if there are two users have made simultaneous changes. Those heads could be merged with the merge command.

Check out a certain revision

  bar update <revision>

Revert local changes

  bar revert

  bar revert <revision>

Commit files

To add files or add changes you call the commit command. Please note, that there is no separate command to first add files like in other vcs.

  bar commit

  bar commit <files or pattern>

Push and Pull

To push changes to a remote repository simply call

  bar push

The same way you could get new changes from remote by calling

  bar pull

If you want to sync to another repository then the default remote one, you need to put the remote url as parameter

  bar push ssh://user@machine//path/to/repo

  bar pull ssh://user@machine//path/to/repo


Bar supports tagging revisions. Internally it works the same way as tags in mercurial. They are saved in a tag file “.bartags” in the working dir and are versioned as any other file.

List all tags:

  bar tags	

add a tag to the current revision:

  bar tag -a tagname

delete an existing tag:

  bar tag -d tagname

basicusage.txt · Last modified: 2014/10/24 14:47 by lang