threads / discuss / 18576

Git for collaborative web development

Subject: Git for collaborative web development

## tl;dr

5 messages between Mar 26, 2009 and Mar 27, 2009.

replies: 4people: 3as markdown or json

Carlo· Mar 26, 2009, 18:51 UTC · lore

Hi, I'm going to work on a web project with a friend. We will host our code on a server and my idea was to set up a git repository (maybe using gitosis) so that we could work on our machines and push the changes to the server.

He said that it would be complicated, because if he's going to try some changes to show me on the fly he just can't. I mean, he would like to work on the code directly on the server, so that he can change the code, save and I can just refresh the page from my browser and see what he did.

Using git he should save, commit, add, push... so it's a bit longer.

Is there a nice compromise? Or a better way to use git for such a task or web development in general?

Thanks for your help, bye.

Sverre Rabbelier· Mar 26, 2009, 19:18 UTC · re: Carlo · lore

Re: Git for collaborative web development

Heya,
On Thu, Mar 26, 2009 at 19:51, Carlo <mr.spoon21@gmail.com> wrote:
> Using git he should save, commit, add, push... so it's a bit longer.
>
> Is there a nice compromise? Or a better way to use git for such a task or web
> development in general?

$ git config alias.tryout "!git branch -f tryout && git checkout tryout && git add . && git commit -m TryOut && git push shared_repo tryout"

You can even see the page live if you set the proper attributes ;).
-- 
Cheers,

Sverre Rabbelier
Mr.SpOOn· Mar 26, 2009, 19:41 UTC · re: Sverre Rabbelier · lore

Re: Git for collaborative web development

2009/3/26 Sverre Rabbelier <srabbelier@gmail.com>:
> $ git config alias.tryout "!git branch -f tryout && git checkout
> tryout && git add . && git commit -m TryOut && git push shared_repo
> tryout"

That seems cool. I'll take a look to some documentation to understand it :D Thanks.

Sverre Rabbelier· Mar 26, 2009, 19:44 UTC · re: Mr.SpOOn · lore

Re: Git for collaborative web development

Heya,
On Thu, Mar 26, 2009 at 20:41, Mr.SpOOn <mr.spoon21@gmail.com> wrote:
> That seems cool. I'll take a look to some documentation to understand it :D

There's probably some typo's and thinko's in there, but you get the idea. You can use aliases in git to define your own commands. If you do not prefix the command with a bang it is interpreted as git command, I use this one to review the changes I made with respect to origin:

$ git config alias.new "log -C -M --reverse -p origin/master.."
-- 
Cheers,

Sverre Rabbelier
Giuseppe Bilotta· Mar 27, 2009, 00:57 UTC · re: Carlo · lore

Re: Git for collaborative web development

On Thursday 26 March 2009 19:51, Carlo wrote:
Show 14 quoted lines
> Hi,
> I'm going to work on a web project with a friend. We will host our code on a
> server and my idea was to set up a git repository (maybe using gitosis) so that
> we could work on our machines and push the changes to the server.
> 
> He said that it would be complicated, because if he's going to try some changes
> to show me on the fly he just can't. I mean, he would like to work on the code
> directly on the server, so that he can change the code, save and I can just
> refresh the page from my browser and see what he did.
> 
> Using git he should save, commit, add, push... so it's a bit longer.
> 
> Is there a nice compromise? Or a better way to use git for such a task or web
> development in general?
You could try using gitweb to expose the local repository directly.

If the web pages don't rely on hard-coded paths (i.e. all links are relative) you should actually be able to navigate the tentative website in plain blob view mode, for any given commit or branch.

-- 
Giuseppe "Oblomov" Bilotta

← back to recent threads