Bazaar commands

  • Check-out in the local openerp-server folder the 6.0 branch of the OpenERP server project from Launchpad:
    bzr branch lp:openobject-server/6.0 openerp-server
    
  • Same command as above, but fetch a particular revision:
    bzr branch lp:openobject-server/6.0 -r 3425 openerp-server
    
  • Get revision number of the local copy we sit in:
    bzr revno ./
    
  • Remove lock file on the current repository:
    bzr break-lock
    

Git commands

  • Get a clean local copy of my GitHub repository with read & write access:
    git clone git@github.com:kdeldycke/scripts.git
    
  • Switch to another branch:
    git checkout another_branch
    
  • Set the current repository in the state it was at commit 1234567:
    git checkout 1234567
    
  • Get the current commit number:
    git rev-parse HEAD
    
  • Print a nice graph of your commits sorted by date:
    git log --graph --all --pretty=oneline --abbrev-commit --date-order
    
  • Destroy all your local changes and get back a sane repository:
    git reset --hard
    
  • Send local repository modifications to remote one:
    git push origin
    
  • Attach a tag to a given commit:
    git tag "1.2.3" 8fe2934d1552c97246836987f0ea08e10ba749ae
    
  • Publish all tags to the remote repository:
    git push --tags
    
  • Add a remote repository located on GitHub as a submodule in the ./folder/project-copy folder:
    git submodule add https://github.com/my-id/project.git ./folder/project-copy
    
  • While playing with backups of a local repository, you may encounter this error:
    Cannot rewrite branch(es) with a dirty working directory.
    

    In this case, you can get back a clean repository by removing all the unstaged changes:

    git stash