brians | aede41c | 2013-02-18 04:41:19 +0000 | [diff] [blame] | 1 | Some 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 | |
| 4 | ssh to robotics.mvla.net and add the git executables to your .bashrc: |
| 5 | PATH=$PATH:/www/https/files/frc971/2013/brian/ |
brians | aede41c | 2013-02-18 04:41:19 +0000 | [diff] [blame] | 6 | |
| 7 | [Cloning] |
| 8 | `git clone \ |
jerrym | cea3b8d | 2013-03-11 07:57:37 +0000 | [diff] [blame^] | 9 | 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 |
brians | aede41c | 2013-02-18 04:41:19 +0000 | [diff] [blame] | 11 | repo you want to clone |
| 12 | |
| 13 | [Adding Other People's Repositories] |
jerrym | cea3b8d | 2013-03-11 07:57:37 +0000 | [diff] [blame^] | 14 | `git remote add SOMEBODY \ |
| 15 | ssh://USERNAME@robotics.mvla.net/www.https/git/frc971/SOMEBODY/2013.git` |
| 16 | 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] | 17 | git repository |
| 18 | |
brians | ae54f07 | 2013-02-18 05:24:06 +0000 | [diff] [blame] | 19 | [Working with Other People's Repositories] |
jerrym | cea3b8d | 2013-03-11 07:57:37 +0000 | [diff] [blame^] | 20 | `git fetch SOMEBODY` will pull their changes, and then you can rebase on top of |
brians | ae54f07 | 2013-02-18 05:24:06 +0000 | [diff] [blame] | 21 | them etc. |
| 22 | `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^] | 23 | can see them. (This is the default if the configuration option remote.<remote>.mirror is set.) |
brians | 66d5730 | 2013-02-18 05:10:42 +0000 | [diff] [blame] | 24 | |
brians | aede41c | 2013-02-18 04:41:19 +0000 | [diff] [blame] | 25 | [Synchronizing with SVN] |
jerrym | cea3b8d | 2013-03-11 07:57:37 +0000 | [diff] [blame^] | 26 | In 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. |
| 27 | |
| 28 | To do that, `git svn init https://robotics.mvla.net/svn/frc971/2013/trunk/src` |
| 29 | |
| 30 | Then, 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. |
| 31 | |
| 32 | After doing that (and a `git svn fetch`), git-svn works like usual. |
| 33 | |
| 34 | To 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. |
| 35 | |
| 36 | Multiple people dealing with svn works OK because the git commit SHAs end up the same so they all just become the same. |