{"thread":{"id":"25407","subject":"Best single user practice","startedAt":"2010-10-09T22:24:58Z","lastAt":"2010-10-10T15:33:34Z","messageCount":4,"participants":["Maaartin","Kevin Ballard","Jakub Narebski","Andreas Schwab"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"153105","messageId":"loom.20101009T233356-82@post.gmane.org","threadId":"25407","inReplyTo":null,"subject":"Best single user practice","fromName":"Maaartin","fromEmail":"grajcar1@seznam.cz","sentAt":"2010-10-09T22:24:58Z","receivedAt":"2010-10-09T22:24:58Z","isPatch":false,"sender":{"key":"grajcar1@seznam.cz","avatar":null},"body":"I've started using git maybe one month ago, and I'd like to use it for many \nthings including some one-man projects, browser settings backups, and such \nthings. So I always do a local git init, ssh to my server and create a repo \nthere. I copy the .git/config from a working project, and change the remote \nURL. It all works, but it's not perfect.\n\n- Is it not possible to create a remote repository from my own computer without \nssh?\n\n- There's only version 1.5.4.3 on the server and I don't want to update it \nunless strongly recommended so. Should I?\n\n- Because of the low version, I can't use \"git init --bare\" on the server. So I \ncreate an usual depository and change the configuration to bare=true. Is it OK \n(I really don't mind the repo being placed in DIR/.git instead of DIR itself.)?\n\n- The very first time I need to do \"git push origin master\", later \"git push\" \nsuffices. I wonder why.\n\n- My local repository created by \"git init\" (version 1.7.2.3 under cygwin) \ncontains\n[core]\n repositoryformatversion = 0\n filemode = true\n bare = false\n logallrefupdates = true\n ignorecase = true\nbut I'd prefer to specify there as little as possible, since the settings for \nall my repositories should be the same (at least for the moment). What can be \nsafely removed?\n\n- Sometimes, I use \"git push --force\", how do I clean up the resulting garbage \non the server?\n\n- How can I ensure that everything important gets pushed to the server? Maybe \nby using \"git push --mirror\"? Obviously and logically, .git/config doesn't get \npushed, but maybe I miss something more important, too?\n"},{"id":"153108","messageId":"DAA5096E-00DF-4454-A905-EA2E10329DBB@sb.org","threadId":"25407","inReplyTo":"loom.20101009T233356-82@post.gmane.org","subject":"Re: Best single user practice","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2010-10-09T22:44:48Z","receivedAt":"2010-10-09T22:44:48Z","isPatch":false,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"On Oct 9, 2010, at 3:24 PM, Maaartin wrote:\n\n> I've started using git maybe one month ago, and I'd like to use it for many \n> things including some one-man projects, browser settings backups, and such \n> things. So I always do a local git init, ssh to my server and create a repo \n> there. I copy the .git/config from a working project, and change the remote \n> URL. It all works, but it's not perfect.\n\nWhy 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.\n\n> - Is it not possible to create a remote repository from my own computer without \n> ssh?\n\nIf you use a web interface on the server to manage git repos (e.g. Gitorious) you can generally create repos via the web interface.\n\n> - There's only version 1.5.4.3 on the server and I don't want to update it \n> unless strongly recommended so. Should I?\n\n1.5.4.3 is roughly 2 years and 8 months old. I would strongly recommend you update.\n\n> - Because of the low version, I can't use \"git init --bare\" on the server. So I \n> create an usual depository and change the configuration to bare=true. Is it OK \n> (I really don't mind the repo being placed in DIR/.git instead of DIR itself.)?\n\n`git init --bare` is incorrect anyway. What you really want is `git --bare init`.\n\n> - The very first time I need to do \"git push origin master\", later \"git push\" \n> suffices. I wonder why.\n\nThe 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).\n\n> - My local repository created by \"git init\" (version 1.7.2.3 under cygwin) \n> contains\n> [core]\n> repositoryformatversion = 0\n> filemode = true\n> bare = false\n> logallrefupdates = true\n> ignorecase = true\n> but I'd prefer to specify there as little as possible, since the settings for \n> all my repositories should be the same (at least for the moment). What can be \n> safely removed?\n\nWhy 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\n\n> - How can I ensure that everything important gets pushed to the server? Maybe \n> by using \"git push --mirror\"? Obviously and logically, .git/config doesn't get \n> pushed, but maybe I miss something more important, too?\n\nWhat do you consider important besides your branches?\n\n-Kevin Ballard"},{"id":"153109","messageId":"m31v7zf0e0.fsf@localhost.localdomain","threadId":"25407","inReplyTo":"loom.20101009T233356-82@post.gmane.org","subject":"Re: Best single user practice","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-10-09T22:49:25Z","receivedAt":"2010-10-09T22:49:25Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Maaartin <grajcar1@seznam.cz> writes:\n\n> I've started using git maybe one month ago, and I'd like to use it for many \n> things including some one-man projects, browser settings backups, and such \n> things. So I always do a local git init, ssh to my server and create a repo \n> there. I copy the .git/config from a working project, and change the remote \n> URL. It all works, but it's not perfect.\n> \n> - Is it not possible to create a remote repository from my own computer without \n> ssh?\n\nNo, it isn't.  \"git push --create\" / remote \"git init\" is one of\nrequested features for quite some time, but it isn't yet implemented.\n\nIIRC the problem is that without being able to log in to remote\nmachine there are situations when yoy can't resolve problems without\nit.\n\n\nYou can always use \"ssh <user>@<machine> git init <directory>\" (though\nit is not a solution in your case, at least not as given, because \"git\ninit <directory>\" is quite new invention).\n\n> - There's only version 1.5.4.3 on the server and I don't want to update it \n> unless strongly recommended so. Should I?\n\nWell, with 1.5.4.3 you can't use \"smart\" HTTP protocol, but git is\ndeliberately interoperable between different versions of client and\nserver software.\n \n> - Because of the low version, I can't use \"git init --bare\" on the server. So I \n> create an usual depository and change the configuration to bare=true. Is it OK \n> (I really don't mind the repo being placed in DIR/.git instead of DIR itself.)?\n\nThis should be O.K.  And you can always rename DIR/.git ro DIR.git...\n\n> \n> - The very first time I need to do \"git push origin master\", later \"git push\" \n> suffices. I wonder why.\n\nIt is because default git behavior is to push matching branches,\ni.e. all branches having the same name in both ends (you can change it\nusing `push.default` config option, see git-config and git-push\nmanpages).\n\nThis is the default behavior, because it allows you to easily control\nwhich branches you want to have visible in remote repository.\n\n[...]\n> - Sometimes, I use \"git push --force\", how do I clean up the resulting garbage \n> on the server?\n\n\"git gc\" on server.\n\n> \n> - How can I ensure that everything important gets pushed to the server? Maybe \n> by using \"git push --mirror\"? Obviously and logically, .git/config doesn't get \n> pushed, but maybe I miss something more important, too?\n\nYou can always change `push.default`, or you can provide push refspecs\nwhich pushes all branches, like remote.origin.push =\n+refs/heads/*:refs/heads/*\n\nNote that the opissite side of the coin is ensuing that nothing that\ndoesn't have to be pushed didn't get to be pushed.\n\nHTH (Hope That Helps)\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"153147","messageId":"m21v7yvz8x.fsf@igel.home","threadId":"25407","inReplyTo":"DAA5096E-00DF-4454-A905-EA2E10329DBB@sb.org","subject":"Re: Best single user practice","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2010-10-10T15:33:34Z","receivedAt":"2010-10-10T15:33:34Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Kevin Ballard <kevin@sb.org> writes:\n\n> On Oct 9, 2010, at 3:24 PM, Maaartin wrote:\n>\n>> - Because of the low version, I can't use \"git init --bare\" on the server. So I \n>> create an usual depository and change the configuration to bare=true. Is it OK \n>> (I really don't mind the repo being placed in DIR/.git instead of DIR itself.)?\n>\n> `git init --bare` is incorrect anyway. What you really want is `git --bare init`.\n\n`git init --bare' has been added in 1.5.6 as a synonym for `git --bare init'.\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"}]}