Administrator
|
This should be easy but I haven't figured out a solution yet. I have a repository (repo), agentscript. It has not only the core code and "plugins" but docs, models, and js/min.js files which require hosting .. i.e. something that can "serve" these html/js files.
GHPages, the github project hosting service provides this. GHPages works by having a branch, gh-pages, which is stored on their hosting service (not their project site) But to use their hosting service and nifty templates, there are several, 5, extra files/folders generated and live in the branch
I'd like to maintain the branch separately, with the 5 extra files/folders, and periodically add all of the main/master repo to this. I believe the branches would have to remain separate, even tho sharing most of their files.
Git merge won't work, I think. If I merge the master into the branch, the branch becomes the master, and I no longer have separation between the two .. and I pollute the master repo with the extra web service files.
Is there a git trick that would let me maintain two separate branches, and periodically "merge" the master files into the branch, yet keep the 5 branch web service files/folders out of the master? Oh, in addition, the server files need no updating at all after their initial creation. They simply use the project README.md for their "content".
-- Owen ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com |
I recommend Sourcetree for looking at these things more visually. (Google it or go to atlassian.com). It’s free and works with Git and Mercurial. I use it with Mercurial.
I think you can do this with a ‘master’ branch, an ‘extras’ branch, and a ‘release’ branch. What you are doing is close to holomorphic with the “flow” model. See http://nvie.com/posts/a-successful-git-branching-model/ Hope this helps. —Barry On Dec 4, 2013, at 9:19 PM, Owen Densmore <[hidden email]> wrote:
============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com |
In reply to this post by Owen Densmore
Owen, Looks like you have things working just how you want them to. You can keep working in your master branch and whenever you want to update gh-pages, git checkout gh-pages git merge master done. So long as you never merge gh-pages into master you are golden. —joshua On Dec 4, 2013, at 9:19 PM, Owen Densmore <[hidden email]> wrote:
============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com |
Administrator
|
I thought so too. But here's an experiment. master dir has this (Attic is in .gitignore and just has stuff removed): Home|~/src/cs/test3[649]: ls Attic README.md junk.txt
while gh-pages has: Home|~/src/cs/test3[653]: ls Attic images javascripts stylesheets
README.md index.html params.json
I then run this exeriment: go to each branch, check status .. both clean. Then I try the merge.
Home|~/src/cs/test3[655]: git checkout master
Switched to branch 'master' Home|~/src/cs/test3[656]: git status # On branch master
nothing to commit, working directory clean Home|~/src/cs/test3[657]: git checkout gh-pages
Switched to branch 'gh-pages'
Home|~/src/cs/test3[658]: git status # On branch gh-pages
nothing to commit, working directory clean Home|~/src/cs/test3[659]: git merge master
Removing stylesheets/stylesheet.css Removing stylesheets/pygment_trac.css
Removing params.json Removing javascripts/main.js
CONFLICT (modify/delete): index.html deleted in master and modified in HEAD. Version HEAD of index.html left in tree.
Removing images/sprite_download.png Removing images/icon_download.png
Removing images/blacktocat.png Removing images/bg_hr.png
Automatic merge failed; fix conflicts and then commit the result. Home|~/src/cs/test3[660]: git status
# On branch gh-pages # You have unmerged paths.
# (fix conflicts and run "git commit") #
# Changes to be committed: #
# modified: README.md # deleted: images/bg_hr.png
# deleted: images/blacktocat.png # deleted: images/icon_download.png
# deleted: images/sprite_download.png # deleted: javascripts/main.js
# new file: junk.txt # deleted: params.json
# deleted: stylesheets/pygment_trac.css # deleted: stylesheets/stylesheet.css
# # Unmerged paths:
# (use "git add/rm <file>..." as appropriate to mark resolution) #
# deleted by them: index.html #
And the resulting gh-pages looks like:
Home|~/src/cs/test3[661]: ls Attic README.md index.html javascripts junk.txt
So yes, it did merge README.md and junk.txt but for some reason deleted images, javascripts/main, stylsheets and params.json.
I guess there's a configuration problems somewhere. Maybe the way I pulled the gh-pages after creating the website on github? I bet that's it. But I did add . and commit in gh-pages and it all worked with a dummy README.md initially.
The test site is here: and the gh-pages here, with a dummy README
Thanks for the reinforcement, however .. I should go thru all the steps 1-at-a-time and see if there's anything odd there.
-- Owen On Thu, Dec 5, 2013 at 2:46 PM, Joshua Thorp <[hidden email]> wrote:
============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com |
This looks to me like at some point gh-pages was merged to master. So that when you deleted “stylesheets" in master, merging to gh-pages also included this delete action… My guess is that if you added the stylesheets directory back into gh-pages you wouldn’t ever experience this problem again.
—joshua On Dec 5, 2013, at 4:01 PM, Owen Densmore <[hidden email]> wrote:
============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com |
Administrator
|
Wow, sounds quite possible .. I'll try it this evening or tomorrow. I'll also see if there's a git history command that'll help clarify things. Thans! -- Owen On Thu, Dec 5, 2013 at 4:31 PM, Joshua Thorp <[hidden email]> wrote:
============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com |
One last thing: Helps to see where you are, when you have multiple branches in the picture. —joshua On Dec 5, 2013, at 6:51 PM, Owen Densmore <[hidden email]> wrote:
============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com |
Administrator
|
Just looked at it, I like it! BTW: is a post on gh-pages and various ways to manage it. It in turn was one of several responses from this:
which discussed the mirroring approach.
What I REALLY want is a bit further down the first link, below. git push -f origin master:gh-pages
I tried it and ran into trouble, but I think its the same trouble I currently have, getting the branches confused. If it works, I can create a trivial gh-page from the auto generation tool which simply brings in my README.md and makes it the content div of the page. I can then not ever bother with the local gh-pages branch at all!
That'd be nice,
-- Owen Merging via
|
Administrator
|
Success! You were right, Josh, I got some of the steps reversed and sometimes forgot which branch I was in. Fixed that with a new bash PS1 that prints out branches when I'm in a git repo.
The long story short is that the main repo is 6 files/dirs lighter than the gh-pages, much much cleaner. And the github template works fine, you can see it at agentscript.org. If you click on the "view on github" link, it takes you to master. If you click on the gh-pages branch, you'll see the master + the site files.
master: 7 folders, 3 files
gh-pages: 10 folders, 6 files
Its also nice that we can access the .js files via a <script tag with href of
.. ditto for the map files and min files as well as the "extras" plugins. I still would like to find a way where I didn't have to keep the gh-pages branch kept up on the local repo, and just push it "into" not "onto" with the
git push -f origin master:gh-pages suggestion found in the post above.
My main concern is that having a complicated repo can make it difficult for others to fork and ask for a pull request. I'll try to make all steps automated via my Cakefile .. or Grunt if we all decide that's best. But boy, git is bitchy.
-- Owen On Thu, Dec 5, 2013 at 9:59 PM, Owen Densmore <[hidden email]> wrote:
============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com |
Free forum by Nabble | Edit this page |