Git
From Healthcare Robotics Wiki
Revision as of 12:20, 16 March 2012 by Advaitjain (Talk | contribs)
Contents |
Git Repositories for Internal Use
Motivation
- Advait would like to have internal git repositories as well.
- The goal would be to use these for active development and release by merging to a repo on gt-ros-pkg hosted on google code.
Create a new git repository on internal server
- ssh mycroft@skynet
- cd internal_git_bare
- mkdir test_repository
- cd test_repository
- git init
- touch .first
- for some reason git doesn't like completely empty repositories
- git add .first
- git commit -m "initial dummy commit"
- Convert to a bare repository using steps from here:
- cd hrl_haptic_manipulation_in_clutter/
- git config --bool core.bare true
- rm -rf .first
- ls -la
- you should see a .git
Coverting a stack from svn to a git repository
- ssh mycroft@skynet
- cd internal_git_bare
- get a specific folder from svn and make a git repo out of it:
git svn clone https://svn.hsi.gatech.edu/cckemp/robot1/src/projects/hrl_haptic_manipulation_in_clutter - Convert to a bare repository using steps from here:
- cd hrl_haptic_manipulation_in_clutter/
- git config --bool core.bare true
- rm -rf *
- ls -la
- you should see a .git
Steps on each client machine
Clone from the internal server
- cd to whichever directory you want to keep your repo in. (e.g. cd ~/git)
- git clone mycroft@skynet.hsi.gatech.edu:/home/mycroft/internal_git_bare/hrl_haptic_manipulation_in_clutter
To release code
- create an appropriately named release branch.
- push that release branch to the internal server.
- create a new git repository on gt-ros-pkg for the stack to be released.
- clone this gt-ros-pkg repository to your computer.
- add internal repository as a remote branch on your computer's clone of gt-ros-pkg repo:
git remote add -f <release_stack_name> mycroft@skynet.hsi.gatech.edu:/home/mycroft/internal_git_bare/<release_stack_name> - perform a merge:
git merge <release_stack_name>/<release_branch> - optionally reset the history:
git reset --soft HEAD^ - git commit -a
- put in an appropriate release message.
Old stuff
- git checkout google_code_master
- git checkout internal_hrl <path to files to release>
- git commit -a
- type in some descriptive release message.
- git checkout internal_hrl
- switch back to the internal_hrl branch
- ssh to skynet and push to google code.
To get changes from google code repository
Merge the changes in the google_code_master branch with the internal_hrl branch
- git checkout google_code_master
- git pull
- git checkout internal_hrl
- git merge google_code_master
maybe useful commands?
- git checkout --track origin/internal_hrl
- now you will see two branches (master and internal_hrl)
- usually Advait would expect people to work in the internal_hrl branch
Create bare git repository on internal git server
- ssh skynet.hsi.gatech.edu -lmycroft
- mkdir internal_git_bare
- cd internal_git_bare
- Clone gt-ros-pkg with advait as the user on skynet.hsi.gatech.edu:
git clone https://advaitjain@code.google.com/p/gt-ros-pkg.hrl/ - Convert to a bare repository using steps from here:
- cd gt-ros-pkg.hrl/
- git config --bool core.bare true
- rm -rf *
- ls -la
- you should see a .git
- git branch -m master internal_hrl
- rename master to internal_hrl
Add a remote branch to work directly with the google code repository
- git remote add -f gt-ros-pkg.hrl_google_code https://code.google.com/p/gt-ros-pkg.hrl/
- git checkout -b google_code_master gt-ros-pkg.hrl_google_code/master