Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

g server, doc adjustments

  • Loading branch information...
commit b3ce5484da7772d6299d1bacef7a324e1c84e53e 1 parent 88aa2eb
Olivier Refalo authored
Showing with 15 additions and 17 deletions.
  1. +11 −17 README.md
  2. +1 −0  g2-config.sh
  3. +1 −0  g2-install.sh
  4. +2 −0  g2.sh
28 README.md
View
@@ -41,14 +41,12 @@ This project is an attempt to make the git command line a friendly place: it eas
The software is now available via [HomeBrew](http://mxcl.github.com/homebrew/).
- brew install https://raw.github.com/orefalo/g2/master/homebrew/g2.rb
+ brew install g2
If you already have git installed outside of Brew, the following command should do
brew install --without-git https://raw.github.com/orefalo/g2/master/homebrew/g2.rb
-
-
###Linux (RedHat/Ubuntu):
Please clone the repository, edit either **/etc/bashrc**, **/etc/bash.bashrc** or **~/.bashrc** and add the following code:
@@ -56,7 +54,6 @@ Please clone the repository, edit either **/etc/bashrc**, **/etc/bash.bashrc** o
[[ $PS1 && -f /path/to/g2-install.sh ]] && \
. /path/to/g2-install.sh
-
###Solaris (Partially tested):
Add the following script to **/etc/bashrc** or **~/.bashrc** (or any other file sourcing those).
@@ -72,10 +69,9 @@ Git is not a prerequisite on Windows as the installer comes bundled with it.
Please download the Windows native installer from [this link](https://github.com/orefalo/g2/downloads).
-
#How to use
-The project overides the `g` and `git` commands. Taken without parameters it displays the following output.
+The project overrides the `g` and `git` commands. Taken without parameters it displays the following output.
```
$ g
@@ -99,11 +95,11 @@ G2 Usage:
init <folder> - init a repository
key <?-gen> - displays/generates your ssh public key
mg <?params...> <branch> - merge
- mt <?params...> - fixes conflicts by opening a visual mergetool
+ mt <?params...> - fixes conflicts by opening a visual merge-tool
mv - move (rename) a file
lg - displays commit log
ls <?params...> - list files under source control
- panic - gets you back on HEAD, cleans all untracked files
+ panic - gets you back on HEAD, cleans all un-tracked files
pull/push <?opts> <remote> <branch> - deals with other branches
rb <?params...> <branch> or <upstream> - rebase
rm <params...> - remove files
@@ -111,9 +107,10 @@ G2 Usage:
rs upstream - resets branch to upstream state
rt <?params...> - git remotes management
rv <commit> - reverts commits
+ server - starts a local git:// server on current repo
setup - configures user, key, editor, tools
sh <?-deep> - show commit contents
- sm <?params...> - submodule
+ sm <?params...> - sub-module
ss <?params> - stash
st <?params...> - status
sync <?upstream> - syncs working branch: fetch, rebase & push
@@ -134,7 +131,7 @@ Let's start with the "sexy" one: the g2 prompt.
The prompt shows:
* The current branch name and the hash of the last commit. **M** is used as a substitute for "master"
-* File counts: staged, changed and untracked filed.
+* File counts: staged, changed and un-tracked filed.
* Obviously username and host.
* And finally the path, which smartly truncates at 40 characters.
* The prompt colors will adjust depending of the state of the repository: clean, modified, conflict resolution... etc
@@ -142,7 +139,6 @@ The prompt shows:
Note: file counters can be expensive with large repositories. You may turn off the feature by running `g setup` and setting "Count files in the bash prompt? (true):" to **false**.
-
##Setup
So here you go, you downloaded git for the first time and I bet you are stuck on the ssh key generation. git is so lame and user unfriendly.
@@ -172,7 +168,7 @@ I have some files I want to stage. Do I want `git add .`, `git add -u`, or `git
Without arguments, `g freeze` literally freezes the state of the workspace into the staging area. It's convenient, one command to stage all the changes: additions and deletions. If I need to point the file to stage, I can use `g freeze <path>`.
-Once changes are frozen, they can be commited with: `g ci -m "commit description"`
+Once changes are frozen, they can be committed with: `g ci -m "commit description"`
There is also a handy one way command `g freeze -m "msg"`, that skips the staging area and commits directly.
Ooops, I staged a change that I do not want to commit: I would then use `g unfreeze <path>` to get the file(s) out of the way.
@@ -197,7 +193,6 @@ Working with beginners, I found that an easy way to keep them focused is to prov
Learn to read that tree, it's important: it holds the commit history for the current branch.
-
##Panic!
It happened to all of us. You try a new command (like a rebase) and things don't work as expected: git complains on every commit attempt, the prompt shows a weird status. Suddenly, you feel the urgency to hunt an expert advise: you start hunting the closest git-master: bad luck he's not around! In fact there is no-one to help you! "Damn it ! I wish I never run that command!", you start pulling your hairs and screaming "CVS was so much bettttttter!"
@@ -298,7 +293,7 @@ Note that you may use `g track remote/branch` to set the mapping. For instance,
Before introducing one of the main **g2** features, let me talk about what **NOT** to do when merging with git.
-Please have a glance at these graphs taken from various projects on github. Note how the branches overlap and how these loops make the graphic extremely difficult to read as the number of commiters increases.
+Please have a glance at these graphs taken from various projects on github. Note how the branches overlap and how these loops make the graphic extremely difficult to read as the number of committers increases.
![image](http://orefalo.github.com/g2/images/h2.jpg)
![image](http://orefalo.github.com/g2/images/h3.jpg)
@@ -324,7 +319,6 @@ For the git expert, the command issues a _fetch, a rebase and a push_ with a mul
* Use `g pull` when merging contents from a feature branches.
-
Note: **g2** also supports `g sync upstream` which only fetch and rebase, handy with read-only clones ;-)
##Saving the Work In Progress (WIP)
@@ -368,7 +362,6 @@ For convenience, several commands have been enhanced to accept the "upstream" ke
* g merge upstream - merge local branch from the contents from the upstream
* g sync upstream - pull contents from the server, rebase but **DON'T** push
-
##List of Commands
Please refer to the [cheatsheet](http://orefalo.github.com/g2/).
@@ -413,7 +406,6 @@ Distributed under the GNU General Public License, version 2.0.
##TODO
-
* g remote: when resetting origin, prompt user to override existing
* g track origin/blabla - if origin/blabla not setup, prompt user to fetch from origin
* g br newbranch (from a branch with no remote) -> does prompt to create the branch
@@ -423,6 +415,8 @@ Distributed under the GNU General Public License, version 2.0.
## FIXED / DONE
+* g2 is an official homebrew formula
+* g server - will start a local git server
* optimized branch identification logic
* git-prompt: detect rebase, rather than displaying detached-branch
* Validate that we are in a git repo before any action is run
1  g2-config.sh
View
@@ -72,6 +72,7 @@ $GIT_EXE config --global core.excludesfile ~/.gitignore_global
"$GIT_EXE" config --global alias.st status
"$GIT_EXE" config --global alias.ss stash
"$GIT_EXE" config --global alias.sm submodule
+"$GIT_EXE" config --global alias.server "daemon --verbose --export-all --base-path=.git --reuseaddr --strict-paths .git/"
#"$GIT_EXE" config --global alias.alias "!"$GIT_EXE" config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\: \\2/' | sort"
1  g2-install.sh
View
@@ -38,6 +38,7 @@ tips=(
"${boldon}g2${boldoff} is just easier at undoing things: try ${boldon}g undo commit${boldoff} or ${boldon}g undo merge${boldoff}."
"When lost, ${boldon}g panic${boldoff} is the easiest way to get back on track."
"Use ${boldon}g track${boldoff} to review how local/remote branches are setup."
+"Remember, you may always access the native git command using \"\$GIT_EXE\"."
"Unlike git, ${boldon}g2${boldoff} actions only apply to the current branch.");
echo -n -e "Installing ${boldon}G2${boldoff}.."
2  g2.sh
View
@@ -61,6 +61,7 @@ function __g2_usage() {
${boldon}rs upstream${boldoff} - resets branch to upstream state
${boldon}rt <?params...>${boldoff} - git remotes management
${boldon}rv <commit>${boldoff} - reverts commits
+ ${boldon}server${boldoff} - starts a local git:// server on current repo
${boldon}setup${boldoff} - configures user, key, editor, tools
${boldon}sh <?-deep>${boldoff} - show commit contents
${boldon}sm <?params...>${boldoff} - submodule
@@ -130,6 +131,7 @@ function __g2_eval() {
"rv" "revert"
"revert" ""
"setup" ""
+ "server" ""
"sh" ""
"show" "sh"
"sm" ""
Please sign in to comment.
Something went wrong with that request. Please try again.