blob: 6fc52b5eabb02cac6e01bb766cda7e34f2c43a30 [file] [log] [blame]
Brian Silvermanc693e992013-04-14 22:10:01 -07001Some of us are using git for managing quickly changing code. This file has
jerrymcea3b8d2013-03-11 07:57:37 +00002notes for setting that up.
3
briansaede41c2013-02-18 04:41:19 +00004[Cloning]
5`git clone \
Brian Silverman9b7a6842014-05-05 16:19:11 -07006 ssh://USERNAME@robotics.mvla.net/www/https/git/frc971/SOMEBODY/2014.git`
jerrymcea3b8d2013-03-11 07:57:37 +00007 where USERNAME is your login on the server and SOMEBODY is whoever's git
briansaede41c2013-02-18 04:41:19 +00008 repo you want to clone
Brian Silverman319ba342013-04-14 22:03:36 -07009If you don't have a login on the server, then cloning
Brian Silverman9b7a6842014-05-05 16:19:11 -070010 https://robotics.mvla.net/git/frc971/somebody/2014.git instead should work
Brian Silvermanc2a5ae32013-02-21 20:35:32 -080011 (with your SVN username and password). However, that form of URL is read-
Brian Silverman529508d2013-02-21 20:49:52 -080012 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 Silverman319ba342013-04-14 22:03:36 -070014 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.
briansaede41c2013-02-18 04:41:19 +000019
20[Adding Other People's Repositories]
jerrymcea3b8d2013-03-11 07:57:37 +000021`git remote add SOMEBODY \
Brian Silverman9b7a6842014-05-05 16:19:11 -070022 ssh://USERNAME@robotics.mvla.net/www/https/git/frc971/SOMEBODY/2014.git`
jerrymcea3b8d2013-03-11 07:57:37 +000023 where USERNAME is your login on the server and SOMEBODY is another person's
briansaede41c2013-02-18 04:41:19 +000024 git repository
Brian Silverman319ba342013-04-14 22:03:36 -070025The https:// URL discussed above in [Cloning] will work too.
briansaede41c2013-02-18 04:41:19 +000026
briansae54f072013-02-18 05:24:06 +000027[Working with Other People's Repositories]
jerrymcea3b8d2013-03-11 07:57:37 +000028`git fetch SOMEBODY` will pull their changes, and then you can rebase on top of
Brian Silverman9b7a6842014-05-05 16:19:11 -070029 them, merge them in, etc.
briansae54f072013-02-18 05:24:06 +000030`git push --mirror` will push all of your local branches so that everybody else
jerrymcea3b8d2013-03-11 07:57:37 +000031 can see them. (This is the default if the configuration option remote.<remote>.mirror is set.)
Brian Silvermanc2a5ae32013-02-21 20:35:32 -080032 However, you can not do that with an https:// URL.
brians66d57302013-02-18 05:10:42 +000033
briansaede41c2013-02-18 04:41:19 +000034[Synchronizing with SVN]
Brian Silverman9b7a6842014-05-05 16:19:11 -070035Somebody should occasionally copy all of the files from git (bbb_cape,
36 frc971, and aos) into svn.
Brian Silverman319ba342013-04-14 22:03:36 -070037
38[Server Setup]
Brian Silverman9b7a6842014-05-05 16:19:11 -070039You need a place to store your files. You will need an adminstrator to
Brian Silverman319ba342013-04-14 22:03:36 -070040 create a folder for you in /www/https/git/frc971 (on the server) with the
41 correct permissions and group.
Brian Silvermanc2a5ae32013-02-21 20:35:32 -080042
43[Repository Setup]
Brian Silverman319ba342013-04-14 22:03:36 -070044To create a git repository on the server,
Brian Silverman9b7a6842014-05-05 16:19:11 -070045 `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 Silvermanc2a5ae32013-02-21 20:35:32 -080052In 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 Silverman319ba342013-04-14 22:03:36 -070055
56To 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).