git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Best single user practice
@ 2010-10-09 22:24 Maaartin
  2010-10-09 22:44 ` Kevin Ballard
  2010-10-09 22:49 ` Jakub Narebski
  0 siblings, 2 replies; 4+ messages in thread
From: Maaartin @ 2010-10-09 22:24 UTC (permalink / raw)
  To: git

I've started using git maybe one month ago, and I'd like to use it for many 
things including some one-man projects, browser settings backups, and such 
things. So I always do a local git init, ssh to my server and create a repo 
there. I copy the .git/config from a working project, and change the remote 
URL. It all works, but it's not perfect.

- Is it not possible to create a remote repository from my own computer without 
ssh?

- There's only version 1.5.4.3 on the server and I don't want to update it 
unless strongly recommended so. Should I?

- Because of the low version, I can't use "git init --bare" on the server. So I 
create an usual depository and change the configuration to bare=true. Is it OK 
(I really don't mind the repo being placed in DIR/.git instead of DIR itself.)?

- The very first time I need to do "git push origin master", later "git push" 
suffices. I wonder why.

- My local repository created by "git init" (version 1.7.2.3 under cygwin) 
contains
[core]
 repositoryformatversion = 0
 filemode = true
 bare = false
 logallrefupdates = true
 ignorecase = true
but I'd prefer to specify there as little as possible, since the settings for 
all my repositories should be the same (at least for the moment). What can be 
safely removed?

- Sometimes, I use "git push --force", how do I clean up the resulting garbage 
on the server?

- How can I ensure that everything important gets pushed to the server? Maybe 
by using "git push --mirror"? Obviously and logically, .git/config doesn't get 
pushed, but maybe I miss something more important, too?

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

* Re: Best single user practice
  2010-10-09 22:24 Best single user practice Maaartin
@ 2010-10-09 22:44 ` Kevin Ballard
  2010-10-10 15:33   ` Andreas Schwab
  2010-10-09 22:49 ` Jakub Narebski
  1 sibling, 1 reply; 4+ messages in thread
From: Kevin Ballard @ 2010-10-09 22:44 UTC (permalink / raw)
  To: Maaartin; +Cc: git

On Oct 9, 2010, at 3:24 PM, Maaartin wrote:

> I've started using git maybe one month ago, and I'd like to use it for many 
> things including some one-man projects, browser settings backups, and such 
> things. So I always do a local git init, ssh to my server and create a repo 
> there. I copy the .git/config from a working project, and change the remote 
> URL. It all works, but it's not perfect.

Why do you copy .git/config? Anything that you want to share in all projects should just be put into ~/.gitconfig (this can also be done with `git config --global`). Anything that's put into .git/config should be specific to that particular project.

> - Is it not possible to create a remote repository from my own computer without 
> ssh?

If you use a web interface on the server to manage git repos (e.g. Gitorious) you can generally create repos via the web interface.

> - There's only version 1.5.4.3 on the server and I don't want to update it 
> unless strongly recommended so. Should I?

1.5.4.3 is roughly 2 years and 8 months old. I would strongly recommend you update.

> - Because of the low version, I can't use "git init --bare" on the server. So I 
> create an usual depository and change the configuration to bare=true. Is it OK 
> (I really don't mind the repo being placed in DIR/.git instead of DIR itself.)?

`git init --bare` is incorrect anyway. What you really want is `git --bare init`.

> - The very first time I need to do "git push origin master", later "git push" 
> suffices. I wonder why.

The very first time, it's creating the master branch on the remote. Subsequent invocations of `git push` will detect the presence of the remote master and push to that. The default mode for `git push` is to push all matching branches (e.g. branches that exist on both the local and remote sides).

> - My local repository created by "git init" (version 1.7.2.3 under cygwin) 
> contains
> [core]
> repositoryformatversion = 0
> filemode = true
> bare = false
> logallrefupdates = true
> ignorecase = true
> but I'd prefer to specify there as little as possible, since the settings for 
> all my repositories should be the same (at least for the moment). What can be 
> safely removed?

Why does it matter? These are created by the call to `git init`. There's really no reason to try and remove items from .git/config unless you definitively don't want them. And as I said before, any settings you want in common between your repos should be placed into ~/.gitconfig

> - How can I ensure that everything important gets pushed to the server? Maybe 
> by using "git push --mirror"? Obviously and logically, .git/config doesn't get 
> pushed, but maybe I miss something more important, too?

What do you consider important besides your branches?

-Kevin Ballard

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

* Re: Best single user practice
  2010-10-09 22:24 Best single user practice Maaartin
  2010-10-09 22:44 ` Kevin Ballard
@ 2010-10-09 22:49 ` Jakub Narebski
  1 sibling, 0 replies; 4+ messages in thread
From: Jakub Narebski @ 2010-10-09 22:49 UTC (permalink / raw)
  To: Maaartin; +Cc: git

Maaartin <grajcar1@seznam.cz> writes:

> I've started using git maybe one month ago, and I'd like to use it for many 
> things including some one-man projects, browser settings backups, and such 
> things. So I always do a local git init, ssh to my server and create a repo 
> there. I copy the .git/config from a working project, and change the remote 
> URL. It all works, but it's not perfect.
> 
> - Is it not possible to create a remote repository from my own computer without 
> ssh?

No, it isn't.  "git push --create" / remote "git init" is one of
requested features for quite some time, but it isn't yet implemented.

IIRC the problem is that without being able to log in to remote
machine there are situations when yoy can't resolve problems without
it.


You can always use "ssh <user>@<machine> git init <directory>" (though
it is not a solution in your case, at least not as given, because "git
init <directory>" is quite new invention).

> - There's only version 1.5.4.3 on the server and I don't want to update it 
> unless strongly recommended so. Should I?

Well, with 1.5.4.3 you can't use "smart" HTTP protocol, but git is
deliberately interoperable between different versions of client and
server software.
 
> - Because of the low version, I can't use "git init --bare" on the server. So I 
> create an usual depository and change the configuration to bare=true. Is it OK 
> (I really don't mind the repo being placed in DIR/.git instead of DIR itself.)?

This should be O.K.  And you can always rename DIR/.git ro DIR.git...

> 
> - The very first time I need to do "git push origin master", later "git push" 
> suffices. I wonder why.

It is because default git behavior is to push matching branches,
i.e. all branches having the same name in both ends (you can change it
using `push.default` config option, see git-config and git-push
manpages).

This is the default behavior, because it allows you to easily control
which branches you want to have visible in remote repository.

[...]
> - Sometimes, I use "git push --force", how do I clean up the resulting garbage 
> on the server?

"git gc" on server.

> 
> - How can I ensure that everything important gets pushed to the server? Maybe 
> by using "git push --mirror"? Obviously and logically, .git/config doesn't get 
> pushed, but maybe I miss something more important, too?

You can always change `push.default`, or you can provide push refspecs
which pushes all branches, like remote.origin.push =
+refs/heads/*:refs/heads/*

Note that the opissite side of the coin is ensuing that nothing that
doesn't have to be pushed didn't get to be pushed.

HTH (Hope That Helps)
-- 
Jakub Narebski
Poland
ShadeHawk on #git

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

* Re: Best single user practice
  2010-10-09 22:44 ` Kevin Ballard
@ 2010-10-10 15:33   ` Andreas Schwab
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Schwab @ 2010-10-10 15:33 UTC (permalink / raw)
  To: Kevin Ballard; +Cc: Maaartin, git

Kevin Ballard <kevin@sb.org> writes:

> On Oct 9, 2010, at 3:24 PM, Maaartin wrote:
>
>> - Because of the low version, I can't use "git init --bare" on the server. So I 
>> create an usual depository and change the configuration to bare=true. Is it OK 
>> (I really don't mind the repo being placed in DIR/.git instead of DIR itself.)?
>
> `git init --bare` is incorrect anyway. What you really want is `git --bare init`.

`git init --bare' has been added in 1.5.6 as a synonym for `git --bare init'.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

end of thread, other threads:[~2010-10-10 15:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-09 22:24 Best single user practice Maaartin
2010-10-09 22:44 ` Kevin Ballard
2010-10-10 15:33   ` Andreas Schwab
2010-10-09 22:49 ` Jakub Narebski

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 NNTP newsgroup(s).