Ok, #Git is f**king awesome! I take everything negative I ever said about it back.
I've been able to configure my webserver so that it does a pull via a webhook every time a repo is updated.
This means I can update my code, push it, and it's automatically reflected on the live site.
Billy basic for many devs here I imagine, but I'm really enjoying the learning experience and the cool things that can be done with Git.
@kev If you are in the market for a git client for iOS, I can recommend Working Copy. I do a lot of my site development on my iPad.
@jamie I don't think I'm quite there yet. I don't really do any coding on my iPad or phone. Thanks for the offer though.
@kev Have you heard about commit hooks? You can format code before committing, make sure tests pass, or optimise PNG files to take up less space: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
@kev If you want to push straight to the web server instead of using a webhook, you can set the config flag:
git config receive.denyCurrentBranch updateInstead
~ $ ssh user@my-webserver
/srv $ mkdir my-site
/srv $ git init
/srv $ git config # ...
/srv $ logout
~ $ git clone user@my-webserver:/srv/my-site
~ $ # make some changes
~ $ git add -A . && git commit && git push origin master
It is also one of my favorite features.
I blog about it some years ago.
@kev *kev*: git is absolute horsecr*p!
*Also kev*: git is f*cking awesome!
@kev Well done sticking with it and understanding how it works before ditching it… You did more than what most people do when encounting their first issue and give up…
@kev I did something similar with I set a cronjob pulling and overwrite the folder then other cronjob to execute the scrypt + then the device sends a notification/log to know if the change were ran ok
@kev Haha, so you found the "git gud" command! 😀️
@kev Did you get it to work in Atom? Or are you using the command line?
@cavaliertusky once I had it working from the CLI, Atom worked like a charm.
@kev That's what I do with my hugo website :)
@kev it’s awesome to see you go from “git is awful” to “my webserver is now updated automatically via git hooks! Git is awesome” in what’s essentially just a couple hours. Bravo 👏
@reykjalin yeah, pretty much. It has improved my workflow so much.
@kev it’s always great when things like this just *click*! Happy to hear it’s working well for you 🙂
Just wait until you get to rebasing and become a time traveler; rewriting history however you please! 🧙♂️
Recently learnt about Git too. Currently I have an alias assigned to an rsync command I use to instantly update my site files over SSH. I'll have to look into webhooks.
@kev have a favorite guide for that?
@joseph for what? The webhooks, or Git in general?
@kev web hooks
@joseph my web server is running Plesk, and they make it SUPER simple to do. Here’s the documentation for Plesk on the matter, but I’m sure there’s documentation out there for more generic ways of doing this.
Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.