On Wednesday, October 24, 2012 11:14:55 PM UTC+2, Joe Cabezas wrote:

> hello!
>
> i want to show uncommited changes using git instaweb, but instaweb only 
> shows commited changes...
>
> i just want to show the git diff output to someone easy..., there is any 
> alternatives to git instaweb?, thank you
>

Interesting question. With a little trickery, you can get instaweb to do 
what you want.

Here's an example, I'll say I'm working on a repository ~/projects/gitblit

Step 1: Set up a temporary git repo to run instaweb and share your 
work-in-progress (WIP), and by that I mean your uncommitted changes:

cd ~/temp
git clone ~/projects/gitblit
cd gitblit
git config receive.denyCurrentBranch ignore #so we can push into this repo 
from our working repo
git instaweb

Now check that it's running properly on http://localhost:1234/

Step 2: Commit your working repo local changes into the sharing repo you 
just created, while leaving them intact in your working repo:

cd ~/projects/gitblit
# make some changes
git push -f ~/temp/gitblit master && GIT_DIR=~/temp/gitblit/.git git add -A 
&& git commit -m "WIP"

Now check that there's a new commit called "WIP" on top 
in http://127.0.0.1:1234/?p=.git;a=summary

The one-liner above (you might consider saving it in a script of sorts) 
does the following:

a) git push -f.. this resets the shared/instaweb repo to have the same 
state as your working repo
b) Sets GIT_DIR to the shared repo, meaning it will be used for the next 
add/commit

Will that work for you?

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/CCGZvKr2BUIJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.

Reply via email to