Git is a fantastic but complex tool. By wrapping several actions that form common workflows into a handful of flags, qwikGit increases productivity and decreases the chances of errors while performing basic source control tasks.
The design around qwikGit works best for an individual coder having the following workflow:
devbranch, merging with
devbranch and optionally pushing to
devbranch because the new features are not so awesome, after all
Although qwikGit provides many shortcuts, it is not a tool really suited for a team working together on the same codebase.
In order to use qwikGit, you need to have the following software installed on your system:
qwikGit has not been tested on Windows (if you do, let me know) but it works great on Linux and OS X.
If the prerequisites are installed, installing qwikGit couldn't be any easier. Just type this in your terminal:
gem install qwikgit
Nothing else. This command will fetch qwikGit on RubyGems.org, install it and make it available anywhere on your system. Fantastic!
Here are the main commands you'll likely use in qwikGit. If you forget one, just type
qgit in your terminal and all the options will be listed (and explained!).
qgit -i (or --init) [--no-c]
Inits a local Git repository, adds all files and commits them with the message 'initial commit'. Prompts you for a remote Git repository. If remote repository selected, it will also push your local repository.
Use the optional
--no-c switch to bypass the commit and the prompt for a remote repository.
qgit -c (or --commit) ["message"]
Adds all files and commits them with the optional
"message". If no message is given, you'll be prompted for one.
qgit -r (or --remote) [name]
Adds a remote repository named after the optional [name]. If no [name] is given, it will be named 'origin'.
You will be prompted for the remote repository URL.
qgit -p (or --push) [name]
Pushes the local master branch to the remote [name] repository. If no [name] is given, your local master branch will be pushed to 'origin'.
qgit -g (or --get) [name]
The remote [name] repository master branch will be pulled into your local master branch. If no [name] is given, 'origin' will be used.
qgit -b (or --branch) [name]
Creates and moves to a new local branch [name]. If no [name] is given, 'dev' will be used.
qgit -cp (or --commit-push) [name]
You'll be prompted for a commit message. Then, all files will be added and committed. The local commit will be pushed to [name]. If no [name] is given, 'origin' will be used.
qgit -m (or --merge) [name]
All files on branch [name] will be added and committed. You will be prompted for a commit message. Then, branch [name] will be merged into master and then deleted. If no [name] is given, 'dev' will be used.
qgit -cmp (or --commit-merge-push) [branch-name [remote-name]]
All files on branch [branch-name] will be added and committed. You will be prompted for a commit message. Then, branch [branch-name] will be merged into master and deleted. Your master branch on local repository will be pushed to [remote-name].
If no [branch-name] is given, [branch-name] will default to 'dev' and [remote-name] to 'origin'. If a [branch-name] is given but no [remote-name], [remote-name] will default to 'origin'.
qgit -l (or --log)
Display the commits history in a readable format.
qgit --ignore [name]
[name] can either be
qgit --discard [name]
All files in branch [name] will be added and then commited. Your repo will then switch to your master branch and delete the branch [name], without merging the changes. If no [name] is given, 'dev' will be used. Use with caution!
This gives you three options: deleting all the files created after last commit, rolling back to the previous commit before the current one or removing all the uncommitted changes. You will be asked to choose if you want to force push your changes to your remote repository. Use with caution!
Updates qwikGit to its latest version by issuing 'gem update qwikgit'.
qgit -v (or --version)
Display qwikGit current version number.
You use qwikGit and you want to contribute? Seriously? Wow... well, fork it, add the features you'd like to see and submit a pull request. It's that easy!
Copyright (c) 2014 - Nico Schuele. See MIT-LICENSE for further details.
Working on many different projects, I always use the same Git workflow. In order to automate some of it, I created a collection of Bash scripts. My collection has grown so I took the time to rewrite them in Ruby and package them as a gem for everybody to use.
git add -A . git commit "some message" git checkout master git merge dev git push origin master git branch -d dev
And that's what qwikGit is all about: speeding up common Git actions.
-- Nico Schuele, Jan 2014