-
Notifications
You must be signed in to change notification settings - Fork 0
Repository Management
Perform a standard clone command to get the repository. Then setup branches with remote tracking for anything you want to use. For example:
git checkout --track origin/gh-pages
This will give you a local copy of the remote branches that are tracked for pushing, pulling, and merging.
Note to self: remember to use git merge --rebase so the history doesn't look ugly.
This repository makes use of the git hub pages support (http://pages.github.com/) to automatically publish web content from the git hub repository.
The method we use is to keep the gh-pages branch as an exact copy of the master branch. We do this by merging all changes to master into the gh-pages branch and pushing the results up to the repository.
The commands used are:
git checkout gh-pages
git merge master
git checkout master
git push
Note: There may be an easier way to do this by setting up a link that makes gh-pages always track the remote master reference, but I have not been smart enough to figure this out yet. If you know how, please let me know.
We track 3rd party dependencies in two ways.
- Source drops
In this case, we simply drop the source into place and update it whenever we need. This works well when we have small projects that don't have a remote GIT or SVN repository.
Adding a package
unzip package.x.y.z.zip
mv package.x.y.z package
git add package
git commit -a -m “Initial import of Package X.Y.Z”
git push origin master
Updating a package
# Updating a package
rm -rf package
unzip package.x.y.z.zip
mv package.x.y.z package
git add package
# Make sure all files are in place and staged (add, remove, changed)
git commit -a -m “Import of Package X.Y.Z”
git push origin master
- Use Braid
This app makes me happy. It helps with tracking remote Git and svn repositories and doing all the commands behind the scene to make it happen. Learn to use it and enjoy the pain free joy.
- Tracked Git Repositories
Note: We don't use Git submodules because they do not flow through to the gh-pages checkouts. (actually they do: https://github.com/blog/410-pages-2-0 just have to make sure you reference the submodules using the public URLs. )
We use subtree merging to do this.
For references, see:
- http://progit.org/book/ch6-7.html
- http://help.github.com/subtree-merge/
- http://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html
This is used to maintain copies of remote master git repositories without our repository to make use of these dependencies.
I am using the method outlined in the ProGit book. It sets up branch to track the remote repositories and makes it fairly straight forward to pull updates in and get them connected to the repository. (note: there is another method outlined in github documentation above that seems to do this without the branch. YMMV)
$ git remote add jasmine_remote https://github.com/pivotal/jasmine.git
$ git fetch jasmine_remote
warning: no common commits
remote: Counting objects: 4576, done.
remote: Compressing objects: 100% (1438/1438), done.
remote: Total 4576 (delta 3218), reused 4264 (delta 3000)
Receiving objects: 100% (4576/4576), 1.72 MiB | 74 KiB/s, done.
Resolving deltas: 100% (3218/3218), done.
From https://github.com/pivotal/jasmine
* [new branch] gh-pages -> jasmine_remote/gh-pages
* [new branch] master -> jasmine_remote/master
...
From https://github.com/pivotal/jasmine
* [new tag] 0.10.1-release -> 0.10.1-release
...
$ git checkout -b jasmine_master_branch jasmine_remote/master
Branch jasmine_master_branch set up to track remote branch master from jasmine_remote.
Switched to a new branch 'jasmine_master_branch'
$ git read-tree --prefix=deps/jasmine/ -u jasmine_master_branch
$ git commit
This should have it setup and ready to use.
Updating the dependencies consistes of checking out the dependency tracking branch and then pulling the code into this branch. Once that is done, it can be merged back into the master and committed to track the updates.
The commands are:
$ git checkout jasmine_master_branch
$ git pull -v
$ git checkout master
$ git merge --squash -s subtree --no-commit jasmine_master_branch
$ git commit
Note: If you get a message about problems with submodule's when pushing to gh-pages, be sure there are no links to submodules that use the internal git link. They should all use the public links.