On Friday, October 26, 2012 11:56:36 AM UTC+2, Konstantin Khomoutov wrote:

> > Can someone who uses a local email client please send me a copy of 
> > the message I posted here? 
>
> Done. 
>

Thanks! I'll post it here again in case someone misses it:


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

So, every time you want to share your current changes, just run the above 
one-liner (or script), and point people to the latest commit "WIP" in your 
instaweb.

-- 
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/-/Hk4-zjQcd3UJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.

Reply via email to