Follow

Ok, 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: git-scm.com/book/en/v2/Customi

@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

anthony.som.codes/blog/2019-12

@kev Imagine:

~ $ 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

@kev *kev*: git is absolute horsecr*p!
*Also kev*: git is f*cking awesome!

@blacklight447 hahaha that's how I roll! 🙂

That's why I put the following in my disclaimer:

In addition, my thoughts and opinions change from time to time; I consider this a necessary consequence of having an open mind.

kevq.uk/disclaimer/

@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 :raspberrypi: 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 Well then, you can also try building your own git hosting server like what I did sorcia.org

😀

I know it's not feature-rich, but at-least it is quite fine for hosting my projects.

@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! 🧙‍♂️

@kev
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.

@joseph for what? The webhooks, or Git in general?

@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.

support.plesk.com/hc/en-us/art

Sign in to participate in the conversation
Fosstodon

Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.