Skip to content

dbraga/git-wizzy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Git-Wizzy

Overview

Git-Wizzy or Wizzy for friends is a simple utility that can restores files from an internal cache.

Scenario

Imagine you are working in a team on a project and you are using git. You have a bunch of configuration files you have to commit but in a fake state. See this example related to ruby on rails :

  my_important_project: &my_important_project
    adapter: mysql2
    encoding: utf8
    reconnect: false
    pool: 5
    username: i_dont_want_to_tell_you_my_username
    password: and_neither_my_password
    socket: /var/run/mysqld/mysqld.sock

.. and then you have your local copy with 'real' values. Each time you commit/pull to this repo you have to stash or checkout your real files and merging is painful!

Solution

  wizzy fix

Yep. It's simple

Requirements

  • Clint and PyYaml
  • Git
  • Python [better if >= 2.6 ]
  • You must be a wizard

Installation

  • Install pyyaml
  pip install pyyaml
  • Install clint
  pip install clint
  • Clone the repository

  • Run this command. This will run wizzy executable and also add the alias to your .bashrc

  chmod +x wizzy ; echo 'alias wizzy="./wizzy "' >> ~/.bashrc && . ~/.bashrc
  • Copy wizzy and wizzy_config.ymlin your project folder

  • Open your wizzy_config.yml file and tell him what are the files you want to be magic. Check out this example

  ...
  files: [config/*.yml, config/initializers/secret_token.rb]
  wizzy_cache_directory: .wizzy
  wizzy_directory: .
  wizzy_remote: false

Usage

First Time

  • You should add all the wizzy files to the .gitignore . Just run this command
  echo -e 'wizzy \nwizzy_config.yml' >> .gitignore
  • Install wizzy wizzy install

All the times

  • Each time you need to restore files just type wizzy fix

  • If you want to create the cache just type wizzy install

  • Do you want to track/untrack your restored files ? wizzy track or wizzy untrack

  • Do you want to track a new file ? You could modify the wizzy_config.yml .. or just type wizzy add <file>

  • Do you want to untrack a old file ? You could modify the wizzy_config.yml .. or just type wizzy remove <file>

  • Do you want to check if you screwed the configuration of wizzy? of if you added an phantom file? wizzy check

  • Of course what is better than a doctor when wizzy is sick? wizzy doctor

  • Do you want the list of all files wizzy tracks ? wizzy list

  • Don't remember a spell? wizzy help

Support

Author

This product was developed by Damiano Braga.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages