Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Github question: when to update your fork?

1582576146

Edited 1582576463
vÍnce
Pro
Sheet Author
Just curious how other sheet authors handle this?  Normally, as soon as the weekly pull requests have been merged, I delete my branches for any sheet updates I made pulls for and update my fork directly from the roll20 repo page(new pull request>compare across forks). This used to work fine, but I've noticed lately that I have merge conflicts for some reason when I go to submit new pull requests the following week...  I sometimes need to delete my fork and start fresh.  Major pain.  How do you handle keeping your fork and local/cloned copy updated?  Thanks
1582576716
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I'd like to know a simple way, too. I've never updated the version of Dealer on the repo because I couldn't figure out a simple way.
1582580162
Kraynic
Pro
Sheet Author
I delete my fork and start fresh on the weekend.  That way, if they have had to do any emergency changes during the week, those are all done.  Usually I am submitting my pull requests on Sundays, so Saturday or Sunday is when I get a fresh fork of the repository.  No problems with conflicts so far.
1582581367
GiGs
Pro
Sheet Author
API Scripter
The problem is your fork doesnt automatically update. Your own files are up to date, but apart from those, the rest of your fork is frozen at the time you made it, and gets more and more out of date as time goes on. Sooner or later this will create conflicts.&nbsp; There are ways to update a fork without deleting and starting over. If you use Git its pretty easy, but most of us use the Github desktop application, and that's quite a bit more complicated. (At the end of this post might be the easiest way, but first, the manual way which I've used several times before): Access your forked repository on Github. Click “Pull Requests” on the right, then click the “New Pull Request” button. Github first compares the base fork with yours, and will find nothing if you made no changes, so, c lick “switching the base”, which will change your fork to the base, and the original to the head fork. Now you should see changes where your fork needs to play “catch up”. Click “Create Pull Request”, give it a name, click “Send Pull Request”. Click “Merge Pull Request” and “Confirm Merge”. I've bolded the step which caused me the most confusion. Initially it will show you your fork as the base, and the roll20 fork as the other - your need to switch them as described in this step. The process is shown with pictures here:&nbsp; <a href="https://stackoverflow.com/questions/20984802/how-can-i-keep-my-fork-in-sync-without-adding-a-separate-remote/21131381#21131381" rel="nofollow">https://stackoverflow.com/questions/20984802/how-can-i-keep-my-fork-in-sync-without-adding-a-separate-remote/21131381#21131381</a> &nbsp;. It looks more complicated than it is. It's a chore to do this, but I just found a possible really simple solution (if it works, testing now):&nbsp; <a href="https://github.com/apps/pull" rel="nofollow">https://github.com/apps/pull</a> &nbsp; Go to that link, and you can install a github app to your account which automatically updates your repositories every&nbsp; hour. I just installed it to test. You can select specific repositories (like the character sheets and api scripts repos) as I did. I'll let you know tomorrow if it works...
1582585040

Edited 1582585050
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
That would be great. The Aaron showed me the trick you mentioned about switching, but it bewildered me.
1582587565

Edited 1582587807
GiGs
Pro
Sheet Author
API Scripter
I am very happy to confirm that Push app i linked has worked-&nbsp; my github fork has updated itself since I posted about it. Remember - this just updates your online repository. You'll also need to open github desktop to sync the changes from your online fork to your local files, but that is easy - just clicking a button in the program.
1582591425

Edited 1582591444
vÍnce
Pro
Sheet Author
very nice GiGs.&nbsp; Github has always been a bit of a pain.&nbsp; I'll give that link a go. Should definitely make things simpler.
1582592877

Edited 1582592918
vÍnce
Pro
Sheet Author
THAT is so much easier!
1582609355
Caden
Forum Champion
Sheet Author
API Scripter
Compendium Curator
The manual way to do it is my fetching the upstream and merging it into your master. There are directions in the GitHub wiki .
1582613308

Edited 1582614436
Andreas J.
Forum Champion
Sheet Author
Translator
Cassie said: The manual way to do it is my fetching the upstream and merging it into your master. There are directions in the GitHub wiki . Yeah, doing things in the command line makes things so much quicker. And considering how often I do it, I've streamlined it with creating an command alias, together with other git aliases that comes with Oh My Zsh(linux) to simplify my workflow. How to set up Roll20 as an remote(onetime): git remote add upstream <a href="https://github.com/Roll20/roll20-character-sheets.git" rel="nofollow">https://github.com/Roll20/roll20-character-sheets.git</a> (this will define a new "remote" for your repo, and naming it "upstream" is common practice when it comes to the parent source of your fork.) My repo update workflow: git checkout master (sets you to your master branch if you aren't there already) git pull upstream master (pulls any updates from the main Roll20 repo and saves it on your computer) git push (pushed the updates from your computer to your github repo. Now both your GitHub repo and the one on your computer is up to date with latest updates from Roll20) If someone is wondering why my workflow looks diiferent from the one linked in the wiki, it's because "pull" performs the function of both "fetch" and "merge", reducing the amount of needed commands. The wiki guide also doesn't mention to "push" your update up to your github, which would update your github repo. if you don't, you've only updated your repo clone you have on your computer, not your github repo. As another comment, if you use commands like "git push" or "git pull" without any extra parameters, it implies that git will pull/push from your default remote, which should be your own fork of the roll20 char sheet repo. How it looks like to me bc I've simplified this often repeated process: gcm gitgud git push
1582618967
Andreas J.
Forum Champion
Sheet Author
Translator
Alright, I'm making a short guide to the github fork update thing &amp; how to do your workflow on your computer using the command line. It will start from scratch, all the way from GitHub account creation. I'll update this post shortly.
1582632086
GiGs
Pro
Sheet Author
API Scripter
Andreas J. said: Alright, I'm making a short guide to the github fork update thing &amp; how to do your workflow on your computer using the command line. It will start from scratch, all the way from GitHub account creation. I'll update this post shortly. It's a good idea to also post a link to that Push app I linked - because then you dont need to do any of that!
1582641849
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Andreas J. said: Alright, I'm making a short guide to the github fork update thing &amp; how to do your workflow on your computer using the command line. It will start from scratch, all the way from GitHub account creation. I'll update this post shortly. Will that require using the desktop app?
1582646350

Edited 1582649251
Andreas J.
Forum Champion
Sheet Author
Translator
keithcurtis said: Will that require using the desktop app? No, it doesn't. It will only require having "Git" installed, and it all the steps should be described in the "First Time Setup" Section. Gigs said: It's a chore to do this, but I just found a possible really simple solution (if it works, testing now):&nbsp; <a href="https://github.com/apps/pull" rel="nofollow">https://github.com/apps/pull</a> Sorry GiGs, I skipped the rest of the replies all the way to Cassie's post, when I saw you had the convoluted GitHub Update method there, and missed that link. Sure, that app seems handy. If I understand it correctly, it only updates your master automatically, but you can manually add other branches to receive updates. My workflow is good enough considering how streamlined it is, and I then retain control of when my fork is updated. I'd use this anyway for only the master branch, and only update my other branches when I want to reduce the change diff and make things more clear in the PR phase. Anyway, I've now made the first version of my " Not-So-Short Git Command Line Guide "(and linked it on related wiki pages). It has a section on how to create a proper Pull Requests( on GitHub, in the browser), that fits with the rest of the command line workflow &amp; examples I've written, that also explains the rationale behind a couple of things the Beginners Guide maybe doesn't. This guide's section on Update Your Fork is much more complete than the one Cassie linked to on Roll20 repo's wiki. Will update with some images for the GitHub guide section, and expand on the rest of the guide, possibly with more workflow examples. I know GitHub have recently released something that would make doing pull requests directly through the command line, but I haven't used it, so can't make a guide on it. Feedback and corrections are welcome. Edit: Ironicly enough, GitHub is having issues since around 10 minutes ago, so y'all can't test this guide until they are back.
Andreas J. said: Anyway, I've now made the first version of my " Not-So-Short Git Command Line Guide "(and linked it on related wiki pages). Thank you so much for this.&nbsp;&nbsp;
1582651235
Andreas J.
Forum Champion
Sheet Author
Translator
Update: GitHub have started to work for some people, including me.
1582652322

Edited 1582661768
vÍnce
Pro
Sheet Author
Awesome response everyone!&nbsp; Using the pull app because it's soooo simple, but I like the other steps to better understand what is actually happening.
1582659701
Caden
Forum Champion
Sheet Author
API Scripter
Compendium Curator
I installed that Push app on my personal fork as well to see if it keeps things updated. If everyone wouldn't remind reporting back on their experience with it that would be helpful. We can add it to the GitHub wiki and encourage others to pick it up. Updating forks seems to be a constant pain point for people. - Cassie
Apparently, the pull app updates too often and can grab from Roll20 and overwrite your changes you are trying to update.&nbsp; Is there a way to change it from once and hour to once a week?
1586305412
vÍnce
Pro
Sheet Author
AFAIK, I don't believe there is a way to change the pull apps frequency.&nbsp; But, as long as you ALWAYS work off of a branch and submit your pull request to roll20's repo from a branch, there shouldn't be an issue.&nbsp; Your fork's master should be the only thing that gets updated by the pull app, not your branches.&nbsp; After the pulls get accepted by roll20's repo manager, you can delete your branch(s), manually trigger the pull app, if needed(the pull app may have already updated your fork...), and simply make a new branch if/when you need to work on another sheet(s).&nbsp; Rinse and repeat.&nbsp; Not sure if you really need to delete and create new branch(s).
1586322190

Edited 1586322244
GiGs
Pro
Sheet Author
API Scripter
Coal Powered Puppet said: Apparently, the pull app updates too often and can grab from Roll20 and overwrite your changes you are trying to update.&nbsp; Is there a way to change it from once and hour to once a week? I think we all discovered this to our cost the same week. As Vince says, its best to work in a separate branch. Delete and creating a new branch isnt strictly necessary, but it's the easiest way to ensure that branch is also up to date. If you dont do it, eventually you will get merge issues because the branch will be out of date.