git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Git Confusion
@ 2009-05-29  7:43 Paul Tarjan
  2009-05-29 12:58 ` Jeff King
  0 siblings, 1 reply; 10+ messages in thread
From: Paul Tarjan @ 2009-05-29  7:43 UTC (permalink / raw
  To: git; +Cc: yury239

Hi all,

I'm new to git and probably doing something very dumb, but I can't
seem to resolve this.

I have a remote repository and a local one. I ssh to the remote
machine, goto the repository directory (not a bare repository), edit a
file and commit it. All if fine.

I leave the remote host and go into the local git directory. Doing
"git pull origin master" says "Already up-to-date." but there is a
file I changed remotely, and I want to pull it locally!

The local repo was made with "git clone http://example.com/.git". I
have no branching (both are on master).

My way around this, is on the remote server, I do a "git push other
master", and then on the local one I do "git checkout HEAD file1" for
each file. Painful and I'm sure it is wrong.

Any ideas? How do you debug this?

Thanks
Paul

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Git Confusion
  2009-05-29  7:43 Git Confusion Paul Tarjan
@ 2009-05-29 12:58 ` Jeff King
  2009-05-29 13:44   ` Jakub Narebski
  0 siblings, 1 reply; 10+ messages in thread
From: Jeff King @ 2009-05-29 12:58 UTC (permalink / raw
  To: Paul Tarjan; +Cc: git, yury239

On Fri, May 29, 2009 at 12:43:35AM -0700, Paul Tarjan wrote:

> I'm new to git and probably doing something very dumb, but I can't
> seem to resolve this.
> 
> I have a remote repository and a local one. I ssh to the remote
> machine, goto the repository directory (not a bare repository), edit a
> file and commit it. All if fine.
> 
> I leave the remote host and go into the local git directory. Doing
> "git pull origin master" says "Already up-to-date." but there is a
> file I changed remotely, and I want to pull it locally!
> 
> The local repo was made with "git clone http://example.com/.git". I
> have no branching (both are on master).

Your repository is accessed over http.  You need to run "git
update-server-info" to build the files for clients to see the actual
updates.

Usually such a repo is bare, and gets updates only by push. In that
case, enabling the update hook to run update-server-info is sufficient.
But in your case, you are actually working on the remote repo via commit
and other means, so there is no convenient way to always
update-server-info after a change.

Is there a particular reason you cloned over http instead of over ssh?

-Peff

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Git Confusion
  2009-05-29 12:58 ` Jeff King
@ 2009-05-29 13:44   ` Jakub Narebski
  2009-05-29 13:52     ` Jeff King
  0 siblings, 1 reply; 10+ messages in thread
From: Jakub Narebski @ 2009-05-29 13:44 UTC (permalink / raw
  To: Jeff King; +Cc: Paul Tarjan, git, yury239

Jeff King <peff@peff.net> writes:
> On Fri, May 29, 2009 at 12:43:35AM -0700, Paul Tarjan wrote:
> 
> > I'm new to git and probably doing something very dumb, but I can't
> > seem to resolve this.
> > 
> > I have a remote repository and a local one. I ssh to the remote
> > machine, goto the repository directory (not a bare repository), edit a
> > file and commit it. All if fine.
> > 
> > I leave the remote host and go into the local git directory. Doing
> > "git pull origin master" says "Already up-to-date." but there is a
> > file I changed remotely, and I want to pull it locally!
> > 
> > The local repo was made with "git clone http://example.com/.git". I
> > have no branching (both are on master).
> 
> Your repository is accessed over http.  You need to run "git
> update-server-info" to build the files for clients to see the actual
> updates.
> 
> Usually such a repo is bare, and gets updates only by push. In that
> case, enabling the update hook to run update-server-info is sufficient.
> But in your case, you are actually working on the remote repo via commit
> and other means, so there is no convenient way to always
> update-server-info after a change.

Well, he can always add git-update-server-info to post-commit hook.

> 
> Is there a particular reason you cloned over http instead of over ssh?

Or git protocol?

-- 
Jakub Narebski
Poland
ShadeHawk on #git

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Git Confusion
  2009-05-29 13:44   ` Jakub Narebski
@ 2009-05-29 13:52     ` Jeff King
  2009-05-29 20:24       ` Paul Tarjan
  0 siblings, 1 reply; 10+ messages in thread
From: Jeff King @ 2009-05-29 13:52 UTC (permalink / raw
  To: Jakub Narebski; +Cc: Paul Tarjan, git, yury239

On Fri, May 29, 2009 at 06:44:26AM -0700, Jakub Narebski wrote:

> > Usually such a repo is bare, and gets updates only by push. In that
> > case, enabling the update hook to run update-server-info is sufficient.
> > But in your case, you are actually working on the remote repo via commit
> > and other means, so there is no convenient way to always
> > update-server-info after a change.
> 
> Well, he can always add git-update-server-info to post-commit hook.

That covers committing, but what about reset, rebase, "branch -f", etc?
I don't think there is a catch-all for all the ways that a repo can be
updated locally.

> > Is there a particular reason you cloned over http instead of over ssh?
> Or git protocol?

Yes, that would work fine, too. I mentioned ssh because he already
indicated that he was able to ssh into the box (and may or may not have
the git daemon set up).

-Peff

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Git Confusion
  2009-05-29 13:52     ` Jeff King
@ 2009-05-29 20:24       ` Paul Tarjan
  2009-05-29 20:28         ` Avery Pennarun
                           ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Paul Tarjan @ 2009-05-29 20:24 UTC (permalink / raw
  To: Jeff King; +Cc: Jakub Narebski, git, yury239

Thank you very much. For skimmers the solution is :

git update-server-info

every time I do something to the remote repo.

The reason I need http is slightly convoluted. The remote machine is
shared hosting with 1 ssh login that I don't want to give to my
partner AND I don't have root on that box. And as you correctly
guessed, that box doesn't have the git demon. The local machine where
he is doing his development. The only solution I saw without giving
him my username + pass to SSH was to do http cloning. Any better
solutions?

Thanks guys, a great first intro to the git community.

Paul Tarjan

On Fri, May 29, 2009 at 6:52 AM, Jeff King <peff@peff.net> wrote:
> On Fri, May 29, 2009 at 06:44:26AM -0700, Jakub Narebski wrote:
>
>> > Usually such a repo is bare, and gets updates only by push. In that
>> > case, enabling the update hook to run update-server-info is sufficient.
>> > But in your case, you are actually working on the remote repo via commit
>> > and other means, so there is no convenient way to always
>> > update-server-info after a change.
>>
>> Well, he can always add git-update-server-info to post-commit hook.
>
> That covers committing, but what about reset, rebase, "branch -f", etc?
> I don't think there is a catch-all for all the ways that a repo can be
> updated locally.
>
>> > Is there a particular reason you cloned over http instead of over ssh?
>> Or git protocol?
>
> Yes, that would work fine, too. I mentioned ssh because he already
> indicated that he was able to ssh into the box (and may or may not have
> the git daemon set up).
>
> -Peff
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Git Confusion
  2009-05-29 20:24       ` Paul Tarjan
@ 2009-05-29 20:28         ` Avery Pennarun
  2009-05-29 20:38         ` Jeff King
  2009-05-29 20:45         ` Jakub Narebski
  2 siblings, 0 replies; 10+ messages in thread
From: Avery Pennarun @ 2009-05-29 20:28 UTC (permalink / raw
  To: Paul Tarjan; +Cc: Jeff King, Jakub Narebski, git, yury239

On Fri, May 29, 2009 at 4:24 PM, Paul Tarjan <ptarjan@gmail.com> wrote:
> The reason I need http is slightly convoluted. The remote machine is
> shared hosting with 1 ssh login that I don't want to give to my
> partner AND I don't have root on that box. And as you correctly
> guessed, that box doesn't have the git demon. The local machine where
> he is doing his development. The only solution I saw without giving
> him my username + pass to SSH was to do http cloning. Any better
> solutions?

It dosen't have the git daemon, or it's not running the git daemon?
You can just run it yourself from your user account, and it's kind of
weird that it wouldn't exist.  (You could build it or copy the binary
from another machine, I suppose.)

Have fun,

Avery

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Git Confusion
  2009-05-29 20:24       ` Paul Tarjan
  2009-05-29 20:28         ` Avery Pennarun
@ 2009-05-29 20:38         ` Jeff King
  2009-05-30  0:41           ` Sitaram Chamarty
  2009-05-29 20:45         ` Jakub Narebski
  2 siblings, 1 reply; 10+ messages in thread
From: Jeff King @ 2009-05-29 20:38 UTC (permalink / raw
  To: Paul Tarjan; +Cc: Jakub Narebski, git, yury239

On Fri, May 29, 2009 at 01:24:59PM -0700, Paul Tarjan wrote:

> The reason I need http is slightly convoluted. The remote machine is
> shared hosting with 1 ssh login that I don't want to give to my
> partner AND I don't have root on that box. And as you correctly
> guessed, that box doesn't have the git demon. The local machine where
> he is doing his development. The only solution I saw without giving
> him my username + pass to SSH was to do http cloning. Any better
> solutions?

You can let him login via ssh key and restrict the actions of that key
just to running git-upload-pack (which is what "git clone" and "git
fetch" will invoke to clone or fetch commits). Something like:

  command="git-upload-pack /path/to/repo" ssh-rsa ...

in your .ssh/authorized_keys file. Not that he still won't be able to
actually push (which is maybe what you want).

For a more featureful solution (with permissions for pushing and pulling
multiple repos), I think gitosis will do what you want (but I have never
used it personally).

-Peff

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Git Confusion
  2009-05-29 20:24       ` Paul Tarjan
  2009-05-29 20:28         ` Avery Pennarun
  2009-05-29 20:38         ` Jeff King
@ 2009-05-29 20:45         ` Jakub Narebski
  2009-05-30  1:32           ` Sitaram Chamarty
  2 siblings, 1 reply; 10+ messages in thread
From: Jakub Narebski @ 2009-05-29 20:45 UTC (permalink / raw
  To: Paul Tarjan; +Cc: Jeff King, git, yury239

On Fri, 29 May 2009, Paul Tarjan wrote:
> Thank you very much. For skimmers the solution is :
> 
> git update-server-info
> 
> every time I do something to the remote repo.
> 
> The reason I need http is slightly convoluted. The remote machine is
> shared hosting with 1 ssh login that I don't want to give to my
> partner AND I don't have root on that box. And as you correctly
> guessed, that box doesn't have the git demon. The local machine where
> he is doing his development. The only solution I saw without giving
> him my username + pass to SSH was to do http cloning. Any better
> solutions?

I see two possible solutions (and you can use both):

1. Have separate publishing repository, which would be bare, and updated
   only via push (so enabling 'update' / 'post-receive' hooks would be
   enough for HTTP). This is good idea also because it makes it possible
   to change commits (rewrite history), e.g. do "git commit --amend"...
   provided that you didn't push part of history you are changing to
   public repository. If you are worrying about disk space, you can
   always set up alternates.

2. Use Gitosis (or ssh_acl) to control access via SSH to repository
   without need to provide extra user accounts, or use git-shell as
   login shell for user accounts which are meant only to access
   repositories. I think you can use Gitosis without being a root...
   see link in BlogPosts page at Git Wiki.

-- 
Jakub Narebski
Poland

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Git Confusion
  2009-05-29 20:38         ` Jeff King
@ 2009-05-30  0:41           ` Sitaram Chamarty
  0 siblings, 0 replies; 10+ messages in thread
From: Sitaram Chamarty @ 2009-05-30  0:41 UTC (permalink / raw
  To: git

On 2009-05-29 20:38:54, Jeff King <peff@peff.net> wrote:
> On Fri, May 29, 2009 at 01:24:59PM -0700, Paul Tarjan wrote:
>
>> The reason I need http is slightly convoluted. The remote machine is
>> shared hosting with 1 ssh login that I don't want to give to my
>> partner AND I don't have root on that box.

[snip]

> You can let him login via ssh key and restrict the actions of that key
> just to running git-upload-pack (which is what "git clone" and "git
> fetch" will invoke to clone or fetch commits). Something like:
>
>   command="git-upload-pack /path/to/repo" ssh-rsa ...
>
> in your .ssh/authorized_keys file. Not that he still won't be able to
> actually push (which is maybe what you want).
>
> For a more featureful solution (with permissions for pushing and pulling
> multiple repos), I think gitosis will do what you want (but I have never
> used it personally).

gitosis is indeed quite featureful.  I use it at work to
admin about 11 projects with between 1-6 devs and it works
very well.  All done with ssh pubkey and the "command="
feature of .ssh/authorized_keys that Jeff mentioned above,
with a bit of python to read a conf file and decide who is
allowed to read/write what repository etc.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Git Confusion
  2009-05-29 20:45         ` Jakub Narebski
@ 2009-05-30  1:32           ` Sitaram Chamarty
  0 siblings, 0 replies; 10+ messages in thread
From: Sitaram Chamarty @ 2009-05-30  1:32 UTC (permalink / raw
  To: git

On 2009-05-29 20:45:55, Jakub Narebski <jnareb@gmail.com> wrote:

>    repositories. I think you can use Gitosis without being a root...

you don't need root for gitosis.  However, this means you
will be using your own "regular work" userid to host gitosis
also, which is a wee bit fiddly.

Apart from things like fixing up PYTHONPATH in advance,
adding a "--prefix=DIR" to the install command, etc., you
should also remember that any pubkey added to gitosis
becomes a "git only" user, so normal ssh won't work for him
anymore.  If your own access to the machine which is now
your gitosis server is via pubkey, you may find yourself
locked out -- don't add that pubkey to gitosis :-)

If the original poster needs more info, I will be happy to
give more details.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-05-30  1:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-29  7:43 Git Confusion Paul Tarjan
2009-05-29 12:58 ` Jeff King
2009-05-29 13:44   ` Jakub Narebski
2009-05-29 13:52     ` Jeff King
2009-05-29 20:24       ` Paul Tarjan
2009-05-29 20:28         ` Avery Pennarun
2009-05-29 20:38         ` Jeff King
2009-05-30  0:41           ` Sitaram Chamarty
2009-05-29 20:45         ` Jakub Narebski
2009-05-30  1:32           ` Sitaram Chamarty

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).