Replying to my post, adding a step 7) git pull -s subtree -X 
subtree=applications/welcome web2py master

It seems this step is necessary before any new commit after step 6 to let 
git know where we are in terms of merge to avoid conflicts later.

On Thursday, August 6, 2015 at 11:10:54 PM UTC-4, Jack Kuan wrote:
>
> Often the starting point of making a web2py app is to copy the welcome app 
> and base your repo on it.
>
> But as you add/modify/delete files from your repo that's based on the 
> welcome app to suit your need, you then face the problem of
> merging updates to the welcome app back to your repo.
>
> I did some googling and tests today, and found that using git subtree 
> merge seems to provide a nice solution to this problem.
> Here are the steps to create a new repo based on the welcome app:
>
> 1) Create an empty git repo:
>     mkdir myapp; cd myapp; git init
>
> 2) Add a file(e.g., .gitignore or README.md) as the first commit.
>     This first commit is required otherwise everything in web2py will be 
> added later.
>
> 3) Add a web2py remote and fetch the repo
>     git remote add -f web2py https://github.com/web2py/web2py
>
> 4) Merge, using the 'ours' strategy, files from web2py's master branch 
> into our master, squash all commits into 1 commit,
>     but don't commit, only create the tree object or something:
>
>     git merge --squash -s ours --no-commit web2py/master
>
> 5) Now add the above merge, taking only the applications/welcome tree, 
> into index, under the root(/):
>
>     git read-tree --prefix=/ -u web2py/master:applications/welcome
>
> NOTE: here I specified /, which makes everything being added directly 
> under the root of the repo.
>             But you can use app/, for example, to add the files of the 
> welcome app under a app/ directory of your repo instead.
>
> 6) git commit
>
> Now you should have a repo that looks like the welcome app.
> If later the welcome app is updated in web2py, here's how you can merge 
> the changes to your repo:
>
> git pull -s subtree -X subtree=applications/welcome web2py master
>
>
> Hope this is useful
> Jack
>
> On Thursday, August 6, 2015 at 1:41:12 AM UTC-4, Joe Barnhart wrote:
>>
>> It seems more and more clear I'm going to be making changes to the 
>> included web2py.js file.  I'm worried about keeping current when new 
>> versions of web2py come out if I've mucked a lot with this javascript file.
>>
>> So what does everyone else do?  How do we customize the platform and 
>> still keep current with its evolution?  Is there an accepted "best 
>> practice" in this area?
>>
>> -- Joe
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to