blob: 1e4b4233609c6a002e21b0e69d454462333a8eee [file] [log] [blame]
briansaede41c2013-02-18 04:41:19 +00001Some us are using git for managing quickly changing code. This file has
jerrymcea3b8d2013-03-11 07:57:37 +00002notes for setting that up.
3
4ssh to robotics.mvla.net and add the git executables to your .bashrc:
5 PATH=$PATH:/www/https/files/frc971/2013/brian/
briansaede41c2013-02-18 04:41:19 +00006
7[Cloning]
8`git clone \
jerrymcea3b8d2013-03-11 07:57:37 +00009 ssh://USERNAME@robotics.mvla.net/www/https/git/frc971/SOMEBODY/2013.git`
10 where USERNAME is your login on the server and SOMEBODY is whoever's git
briansaede41c2013-02-18 04:41:19 +000011 repo you want to clone
Brian Silvermanc2a5ae32013-02-21 20:35:32 -080012If you don't gave a login on the server, then cloning
13 https://robotics.mvla.net/git/frc971/somebody/2013.git instead should work
14 (with your SVN username and password). However, that form of URL is read-
15 only.
briansaede41c2013-02-18 04:41:19 +000016
17[Adding Other People's Repositories]
jerrymcea3b8d2013-03-11 07:57:37 +000018`git remote add SOMEBODY \
19 ssh://USERNAME@robotics.mvla.net/www.https/git/frc971/SOMEBODY/2013.git`
20 where USERNAME is your login on the server and SOMEBODY is another person's
briansaede41c2013-02-18 04:41:19 +000021 git repository
Brian Silvermanc2a5ae32013-02-21 20:35:32 -080022The https:// URL should work too.
briansaede41c2013-02-18 04:41:19 +000023
briansae54f072013-02-18 05:24:06 +000024[Working with Other People's Repositories]
jerrymcea3b8d2013-03-11 07:57:37 +000025`git fetch SOMEBODY` will pull their changes, and then you can rebase on top of
briansae54f072013-02-18 05:24:06 +000026 them etc.
27`git push --mirror` will push all of your local branches so that everybody else
jerrymcea3b8d2013-03-11 07:57:37 +000028 can see them. (This is the default if the configuration option remote.<remote>.mirror is set.)
Brian Silvermanc2a5ae32013-02-21 20:35:32 -080029 However, you can not do that with an https:// URL.
brians66d57302013-02-18 05:10:42 +000030
briansaede41c2013-02-18 04:41:19 +000031[Synchronizing with SVN]
jerrymcea3b8d2013-03-11 07:57:37 +000032In order to synchronize the git commits with svn, somebody has to set up git-svn in their local git repo and then push/pull commits.
33
34To do that, `git svn init https://robotics.mvla.net/svn/frc971/2013/trunk/src`
35
36Then, unless you want git-svn to pull down everything from SVN again, you have to edit .git/refs/remotes/git-svn (or whatever you name the remote) and put in the commit ID of the latest commit in the repository that's from SVN.
37
38After doing that (and a `git svn fetch`), git-svn works like usual.
39
40To pull changes from svn, do `git-svn fetch`. To push changes to svn, do `git svn dcommit`, which will take all of your git commits between the latest commit from svn and your HEAD and make them into svn commits.
41
42Multiple people dealing with svn works OK because the git commit SHAs end up the same so they all just become the same.
Brian Silvermanc2a5ae32013-02-21 20:35:32 -080043
44[Repository Setup]
45In order for https:// access to work, you have to make sure to rename
46 .git/hooks/post-update.sample to .git/hooks/post-update (and then run
47 `git update-server-info` if you're not going to push immediately).