Skip to contentSkip to conversation

Git for collaborative web development

DISCUSSION Carlo 3 participants 5 messages Jun 15, 2016

lore
Share & tools
lore

Carlo

author
#0 lore raw

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.

#1 lore raw

Heya,

Quoted 4 lines · Carlo

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 ;).

Signature · 3 lines
Cheers,

Sverre Rabbelier
author
#2 lore raw

2009/3/26 Sverre Rabbelier <[email protected]>:

Quoted 3 lines
$ 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.

#3 lore raw

Heya,

Quoted 1 line · Mr.SpOOn

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.."
Signature · 3 lines
Cheers,

Sverre Rabbelier
#4 lore raw
In reply to Carlo
Quoted 10 lines · Carlo

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.

Quoted 4 lines

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.

Signature · 1 line
Giuseppe "Oblomov" Bilotta