Brian Silverman | c693e99 | 2013-04-14 22:10:01 -0700 | [diff] [blame] | 1 | Some of us are using git for managing quickly changing code. This file has |
jerrym | cea3b8d | 2013-03-11 07:57:37 +0000 | [diff] [blame] | 2 | notes for setting that up. |
| 3 | |
brians | aede41c | 2013-02-18 04:41:19 +0000 | [diff] [blame] | 4 | [Cloning] |
| 5 | `git clone \ |
Brian Silverman | 9b7a684 | 2014-05-05 16:19:11 -0700 | [diff] [blame] | 6 | ssh://USERNAME@robotics.mvla.net/www/https/git/frc971/SOMEBODY/2014.git` |
jerrym | cea3b8d | 2013-03-11 07:57:37 +0000 | [diff] [blame] | 7 | where USERNAME is your login on the server and SOMEBODY is whoever's git |
brians | aede41c | 2013-02-18 04:41:19 +0000 | [diff] [blame] | 8 | repo you want to clone |
Brian Silverman | 319ba34 | 2013-04-14 22:03:36 -0700 | [diff] [blame] | 9 | If you don't have a login on the server, then cloning |
Brian Silverman | 9b7a684 | 2014-05-05 16:19:11 -0700 | [diff] [blame] | 10 | https://robotics.mvla.net/git/frc971/somebody/2014.git instead should work |
Brian Silverman | c2a5ae3 | 2013-02-21 20:35:32 -0800 | [diff] [blame] | 11 | (with your SVN username and password). However, that form of URL is read- |
Brian Silverman | 529508d | 2013-02-21 20:49:52 -0800 | [diff] [blame] | 12 | only. In order for this to work, you have to either set the environment |
| 13 | variable GIT_SSL_NO_VERIFY to 1 or set the git option http.sslverify to false. |
Brian Silverman | 319ba34 | 2013-04-14 22:03:36 -0700 | [diff] [blame] | 14 | If you get an error like the one below, install a newer version of git. |
| 15 | Unable to find 8fcd87533b76ca5b4b83fb6031ddf0de5e03eb57 under https://robotics.mvla.net/git/frc971/brian/2013.git |
| 16 | Cannot obtain needed object 8fcd87533b76ca5b4b83fb6031ddf0de5e03eb57 |
| 17 | error: Fetch failed. |
| 18 | I get this error sometimes with version 1.7.2.5 but not with version 1.7.10.4. |
brians | aede41c | 2013-02-18 04:41:19 +0000 | [diff] [blame] | 19 | |
| 20 | [Adding Other People's Repositories] |
jerrym | cea3b8d | 2013-03-11 07:57:37 +0000 | [diff] [blame] | 21 | `git remote add SOMEBODY \ |
Brian Silverman | 9b7a684 | 2014-05-05 16:19:11 -0700 | [diff] [blame] | 22 | ssh://USERNAME@robotics.mvla.net/www/https/git/frc971/SOMEBODY/2014.git` |
jerrym | cea3b8d | 2013-03-11 07:57:37 +0000 | [diff] [blame] | 23 | where USERNAME is your login on the server and SOMEBODY is another person's |
brians | aede41c | 2013-02-18 04:41:19 +0000 | [diff] [blame] | 24 | git repository |
Brian Silverman | 319ba34 | 2013-04-14 22:03:36 -0700 | [diff] [blame] | 25 | The https:// URL discussed above in [Cloning] will work too. |
brians | aede41c | 2013-02-18 04:41:19 +0000 | [diff] [blame] | 26 | |
brians | ae54f07 | 2013-02-18 05:24:06 +0000 | [diff] [blame] | 27 | [Working with Other People's Repositories] |
jerrym | cea3b8d | 2013-03-11 07:57:37 +0000 | [diff] [blame] | 28 | `git fetch SOMEBODY` will pull their changes, and then you can rebase on top of |
Brian Silverman | 9b7a684 | 2014-05-05 16:19:11 -0700 | [diff] [blame] | 29 | them, merge them in, etc. |
brians | ae54f07 | 2013-02-18 05:24:06 +0000 | [diff] [blame] | 30 | `git push --mirror` will push all of your local branches so that everybody else |
jerrym | cea3b8d | 2013-03-11 07:57:37 +0000 | [diff] [blame] | 31 | can see them. (This is the default if the configuration option remote.<remote>.mirror is set.) |
Brian Silverman | c2a5ae3 | 2013-02-21 20:35:32 -0800 | [diff] [blame] | 32 | However, you can not do that with an https:// URL. |
brians | 66d5730 | 2013-02-18 05:10:42 +0000 | [diff] [blame] | 33 | |
brians | aede41c | 2013-02-18 04:41:19 +0000 | [diff] [blame] | 34 | [Synchronizing with SVN] |
Brian Silverman | 9b7a684 | 2014-05-05 16:19:11 -0700 | [diff] [blame] | 35 | Somebody should occasionally copy all of the files from git (bbb_cape, |
| 36 | frc971, and aos) into svn. |
Brian Silverman | 319ba34 | 2013-04-14 22:03:36 -0700 | [diff] [blame] | 37 | |
| 38 | [Server Setup] |
Brian Silverman | 9b7a684 | 2014-05-05 16:19:11 -0700 | [diff] [blame] | 39 | You need a place to store your files. You will need an adminstrator to |
Brian Silverman | 319ba34 | 2013-04-14 22:03:36 -0700 | [diff] [blame] | 40 | create a folder for you in /www/https/git/frc971 (on the server) with the |
| 41 | correct permissions and group. |
Brian Silverman | c2a5ae3 | 2013-02-21 20:35:32 -0800 | [diff] [blame] | 42 | |
| 43 | [Repository Setup] |
Brian Silverman | 319ba34 | 2013-04-14 22:03:36 -0700 | [diff] [blame] | 44 | To create a git repository on the server, |
Brian Silverman | 9b7a684 | 2014-05-05 16:19:11 -0700 | [diff] [blame] | 45 | `git init --bare 2014.git` in your folder (ie |
| 46 | "/www/https/git/frc971/USERNAME/"), `cd 2014.git`, |
| 47 | `git config --local gc.pruneExpire never`, `rm -r objects/`, and then |
| 48 | `ln -s /www/https/git/frc971/objects/2014 objects`. That will set you up |
| 49 | with a repository in the standard location and make it so all of the objects |
| 50 | in it won't be duplicated with the identical ones in everybody else's |
| 51 | repositories. |
Brian Silverman | c2a5ae3 | 2013-02-21 20:35:32 -0800 | [diff] [blame] | 52 | In order for https:// access to work, you have to make sure to rename |
| 53 | .git/hooks/post-update.sample to .git/hooks/post-update (and then run |
| 54 | `git update-server-info` if you're not going to push immediately). |
Brian Silverman | 319ba34 | 2013-04-14 22:03:36 -0700 | [diff] [blame] | 55 | |
| 56 | To learn more about git, see git(1) (`man git` or |
| 57 | <http://manpages.debian.net/cgi-bin/man.cgi?query=git>) (especially the NOTES |
| 58 | section). |