Skip to content

Setup Development Repository

althomas edited this page Jun 12, 2012 · 37 revisions

UPennalizers Development Repository built on ENIAC server and will be used for competition. Team member can either clone a new Development Repository or Add it to current open source folder.

Checkout New Development Repository

git clone [pennkey]@eniac.seas.upenn.edu:git/UPennalizers-Dev.git UPennDev

Checkout NaoCompetition

git checkout -tb NaoCompeition origin/NaoCompetition

Code Status

Add Development Repository to Current Repository

This is for experts only! Add New Repository to existing git checkout

git remote add dev [pennkey]@eniac.seas.upenn.edu:git/UPennalizers-Dev.git
git fetch dev

Checkout dev Master

git checkout -tb dev-master remotes/dev/master

Save password to server http://linuxproblem.org/art_9.html

General Guidance for Git

Following Step assume that you cloned a new development repository and in master branch. Try git branch -a to check if there is a * in front of master or git checkout -tb [branchName] remotes/origin/[branchName] to change the base branch. If you added development repository to current folder, change the repository name from origin to dev in all following commands

Commit and push

Always commit with comments and your name

git commit -m "comments" --author='Your Name <email>'

if your laptop, setup your git config by

git config --global user.name "Your Name"
git config --global user.email "Your email"

Make a new branch for you new feature, say a new walk:

git branch nsl-walk
git checkout nsl-walk
git push origin nsl-walk

Work on code here. After you do a "git add" and "git commit", you need to put your updates back to the server

git push origin nsl-walk

If you want to merge recent changes from master, do this:

git checkout nsl-walk
git merge master
git push origin nsl-walk

If you are done with your branch and want to merge it to master, do this:

git checkout nsl-master
git merge nsl-walk
git push origin nsl-master

If want to delete your branch after adding your feature, do this:

git push origin :nsl-walk (this deletes your nsl-walk branch from the private git repo)
git branch -d nsl-walk (this deletes your nsl-walk branch from your local computer)
git remote prune origin

If you want to make sure that you can see any new branches that people have made, do this:

git fetch origin

If you want to export the codebase like svn export

git archive HEAD --format=zip > archive.zip
git archive HEAD | gzip > archive.tar.gz

Source General Notes

  • To work on a pre-existing branch, type:

    • git checkout -tb nsl-existing-branch remotes/nsl/nsl-existing-branch
  • Work on this branch as normal. To commit changes and push them to the NSL repository:

    • git commit -m "My changes are ..."
    • git push nsl nsl-branch-to-push
  • To add a new branch to the NSL repo

    • git branch nsl-new-branch
    • git checkout nsl-new-branch
    • git push nsl nsl-new-branch
  • To Delete this branch when you have merged it to nsl-master:

    • git push nsl :branch-to-delete
  • To update one nsl branches (similar to svn update)

    • git checkout nsl-branch-to-update
    • git pull nsl nsl-branch-to-update
    • To check if there are new branches:
      • git checkout master
      • git fetch nsl
  • To see what is going on:

    • git remote show nsl
  • Resetting bad recent commits

    • git push -f
Clone this wiki locally