Shad Asimov is a user on pipou.academy. You can follow them or interact with them if you have an account anywhere in the fediverse.
Shad Asimov @shad

Okay Mastodon, I need help. help.

I have a github repository for my instance. There is one for the official releases of mastodon. I just want to know if there is an easy, graphical way to "merge" the new releases of mastodon onto my repo, to make sure it doesn't erase my home-made config by checking differences first. Dunno if it makes sense. :oh_no:

Any boost or help can be rewarded with pictures of my lovely cat ! Thank you for your help !

· Web · 11 · 2

@shad I know 0 things about computers but good luck!

@Murkrow Honestly, once you start knowing a bit about computers, you just learn that... you really know nothin' x)
I work it IT, this is very frustrating. Thank you so much for the boost !

@shad you're so close and you don't realise it!
You need to exactly "merge" upstream branch into your branch!
Just look for "git merge" or "how to update fork"
There are tons of graphical tools for merging - usually you just have to resolve things which algorithm is not sure how to merge but you can decide on every change!
I hope it's useful

@charlag Thank you !! I'll look into it ;)

@shad nice! Ping me if you need help, this stuff is tricky

@charlag Hello again !
I've checked what you told me and I think I have the right way to go to update my instance. The thing is, I don't know how to handle the conflicts when merging. Everyone glosses over it like "oh just edit your files and then git add and then tada" but for me it's just not that easy.
On the other hand, comparing and merging in the github website interface is so easy when I do pull request. So I wondered : is there a way for me to
- create an "update" branch
- force pull the upstream on it, no merging, no handling conflict
- push the new branch on my github repo
- and then do the merge with the "graphic" compare ?
I'm sorry if this is savage, I guess I really don't know how to go with this ^^"

@shad hi! No problems. Sorry I've missed your toot.
If you still want to do it locally, you can use some kind of a program - like Meld - to resolve conflicts. Also there are built-ins in some git UIs like GitKraken

If you want to go through web you can do it easier than you described, if I understand correctly. Just make a pull request with "base" as branch in you repo you want to merge into (maybe master) and "head fork" as upstream. I'll send a picture, wait a sec...

@shad I'm going to log off till morning, tell me how it will go!

@charlag Hello ! Just wanted to let you know that Meld is a life-saver, and I was finally able to update my instance thanks to it. Thank you for your advice !

@shad np! I didn't use it myself but it should be good. Glad you've solved it!

@shad My process looks like this. Say version 2.4 just came out:

$ git remote add upstream github.com/tootsuite/mastodon. # Only have to do this once
$ git fetch upstream --tags
$ git rebase v2.4
# Fix conflicts and merge the new .env.production.sample items into my own config
$ git add -u
$ git commit -m 'Updated to v2.4'
$ git push -f origin

@tek Thank you ! This will come in handy ;)

@tek Hello again !
If you don't mind me asking, how do you do the "# Fix conflicts" part ?

@shad `git status` will show you the files that need to be fixed. An editor will show you which changes came from upstream and which ones you made so that you can manually reconcile them.

@shad So I'm always tracking my own branch, never the official one. But every time a new version comes out, I rebase my personal branch onto it to get the new changes. If I run `git diff v2.3.3` right now, I can see the small set of changes that I've personally made to config but no tweaks to the upstream code.

@tek Yeah that's it, I want to check the merge before it's done, last time i tried, i just got my config smashed by the update x)

@shad `git rebase` will complain loudly if there are incompatible changes, and then you can fix them by hand. But I can always `git reset --hard mybranch` to get back to my last known working config. That's a nice safety feature that I use lots!