The following lays out a way to use Git + Git Extensions + Drop Box with an existing Visual Studio 2010 project. This will allow you to collaborate across multiple PC’s on the same project.
There may be quite a few steps, but it’s all quite simple stuff…
- Install Git
- Install Git Extensions
- Install Drop Box
- On the machine with the working Solution / project;
- Browse to your DropBox folder using Windows Explorer
- Create a directory to hold your Cloud Based Repo’s, for example /repos
- Create a directory in your new repos directory to hold your Remote Cloud Based Project Repo, e.g. /repos/myproject/
- Open a Git Gui
- Click “Create a new repository”, and point it to the directory housing the local copy of your Solution / Project.
- Click “Ok”, and let Git Gui create a repository within your Solution location
- Create a .gitignore file in your favourite editor, and add the following sub directories (don’t forget that the directories are case sensitive, and will require a trailing forward slash)
- The “/bin” directory for all projects
- The “/obj” directory for all projects
- Any other directories which you don’t require in your repository
- Open your new repository in Git Gui
- It should show all files ready to be staged and committed in the top left window.
- Make sure this list contains all the files you’re expecting
- Select all files and select “Stage to Commit” from the “Commit” menu
- Add a commit comment such as “Origin”
- Press Commit
- Choose “Add” from the “Remote” menu
- Choose a name for your remote repository. e.g. DropBox
- In windows explorer copy the path to the remote repository contained in your DropBox folder at Step 2 above
- In the “Further Action” section, choose “Initialize Remote Repository and Push”. This should then setup your Cloud Based Repository
- On the Users’ machine who wishes to collaborate;
- Create a directory to house the Solution / Project
- Open Git Gui
- Again create a repository at the location in Step 1
- Again, add a Remote Repository in exactly the same way as in steps 13, 14, 15 and 16 above (NOT step 17!).
- However, in the “Further Action” section, choose “Fetch Immediatly”
- For some reason this doesn’t seem to actually go ahead and fetch all the project files, so flip back to windows explorer
- Browse to the directory of your Solution / Project as created in Step 1
- Right Click on the Directory and go to to Git Extensions –> Pull
- In the “Pull From” section, and the “Remote” Drop Down, select the name of your Remote Cloud Based Repo. e.g. DropBox
- In the “Branch” section, and the “Remote Branch”, select “master”
- In the “Merge Options” section, make sure “Merge remote branch to current branch” is selected and that the “Auto stash” checkbox is clear
- Hit “Pull”
- You should now be able to see all your project files filled into your working directory
You can now;
- Make changes to the project,
- Stage and commit the changes
- Push the Changes to the Remote Cloud Based Repository
- Pull those changes on other machines
- Track changes between machines
- And much more