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

Re: Best single user practice

From
Kevin Ballard <kevin@sb.org>
Date
Oct 9, 2010, 22:44 UTC
Message-ID
<DAA5096E-00DF-4454-A905-EA2E10329DBB@sb.org>
In-Reply-To
<loom.20101009T233356-82@post.gmane.org>
On Oct 9, 2010, at 3:24 PM, Maaartin wrote:
Show 5 quoted lines
> 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).
Show 11 quoted lines
> - 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
Previous: MaaartinNext: Andreas Schwab
Message 2 of 4 in “Best single user practice”
  1. MaaartinOct 9, 2010
  2. Kevin BallardOct 9, 2010
  3. Andreas SchwabOct 10, 2010
  4. Jakub NarebskiOct 9, 2010

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.