git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to push properly a la subversion

From
Dmitry Potapov <dpotapov@gmail.com>
Date
Jul 29, 2009, 19:50 UTC
Message-ID
<20090729195044.GA27178@dpotapov.dyndns.org>
In-Reply-To
<4A7095CE.8030307@gmail.com>
On Wed, Jul 29, 2009 at 08:32:46PM +0200, Matthieu Stigler wrote:
Show 7 quoted lines
>
> I tried just by cloning A to B, changing/commiting B and the pushing to  
> A but: then on A the last log is integrated but I have this message with  
> gitk "local changes checked in to index but not commited", and those  
> local  changes are actually the version of A before the commit from B  
> :-( What I expected with svn mentality is that A is changed and 
> updated...

This is because git-push does not change your working tree. So, your normally should never push to the branch that is currerently checked out. (New versions of Git will warn you about that). As to having a common/shared repo, it should be a "bare" repository.

Show 14 quoted lines
>
> Should I enter a specifical push option? Or rather work on section  
> "Setting up a shared repository"? in  
> http://www.kernel.org/pub/software/scm/git/docs/gitcvs-migration.html ?
> I tried to do it entering:
>
> $ mkdir /pub/my-repo.git
> $ cd /pub/my-repo.git
> $ git --bare init --shared
> $ git --bare fetch /home/alice/myproject master:master
>
> but then I get also this message "local changes checked in to index but  
> not commited" and especially there are many git files appearing that we  
> would not want to see....

Strange... The above commands work perfectly for me.... And if you have a bare repo then it should not have 'index'. So, the error does not make much sense to me... Is it produced by gitk? Hmm, maybe some old version of gitk did not work correctly with a bare repo... I dunno...

> And furthermore it seems there are complicated  
> permissions/ssh issues that I don't need (I'm doing for now only 
> locally).
I don't understand your troubles with permissions. Basically, there are
two options to setup a shared repo:
1. where every developer has each own account
2. a single account (but still each has each own ssh key)

The 'shared' option during init is necessary only for the first case to make repository group writable. All users who can push to it should be members of the group.

If you want to have a single system account for all users, you have two
options:
- gitosis
- ssh based authentification with forced command and then update hook
  if extra check is needed (see Documentation/howto/update-hook-example.txt)
Dmitry
Previous: Avery PennarunNext: Dmitry Potapov
Message 3 of 7 in “How to push properly a la subversion”
  1. Matthieu StiglerJul 29, 2009
  2. Avery PennarunJul 29, 2009
  3. Dmitry PotapovJul 29, 2009
  4. Dmitry PotapovJul 30, 2009
  5. Matthieu StiglerAug 4, 2009
  6. Dmitry PotapovAug 4, 2009
  7. Nanako ShiraishiAug 4, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.