Live data from Hacker News

Show HN: Git-Ready to Deploy? Check for uncommitted and non-pushed changes

github.com

21–26 of 26 posts

Re: Show HN: Git-Ready to Deploy? Check for uncommitted and non-pushed changes

#21
post #9

Earlier quoted context omitted.

This will only spot uncommitted changes to tracked files. I want a completely clean repository before I deploy, where there are neither uncommitted changes to tracked files, nor (new) untracked files. But no, I did not know of git-sh-setup, thanks for the tip :-)

If that's your goal, it might be better to just never deploy from a checked out repository and instead always make a new copy of the code (git clone, git archive, download the tarball from github etc). As in, make the deploy script do that for you, so you never even get into a situation where you could have a dirty working tree in the first place.

You could take it a step further and setup a dead simple server that does it for you and tracks the results in a central place for the whole team. With a manual trigger if you so desired.

Re: Show HN: Git-Ready to Deploy? Check for uncommitted and non-pushed changes

#23

Earlier quoted context omitted.

If that's your goal, it might be better to just never deploy from a checked out repository and instead always make a new copy of the code (git clone, git archive, download the tarball from github etc). As in, make the deploy script do that for you, so you never even get into a situation where you could have a dirty working tree in the first place.

You could take it a step further and setup a dead simple server that does it for you and tracks the results in a central place for the whole team. With a manual trigger if you so desired.

CircleCI etc are decent at this.

Re: Show HN: Git-Ready to Deploy? Check for uncommitted and non-pushed changes

#24
post #16

ok, seriously, is "using git push to do a deploy" a thing? WTF?

What is the correct way in your opinion?

If you have code that needs to compile, pull in packages, load configuration or for any other reason can't just run in production from a clean checkout, then the proper way is to go through a CI server (teamcity, Jenkins, Travis, etc), and have a script that gets from your clean checkout to a package/zip that runs in production.

Re: Show HN: Git-Ready to Deploy? Check for uncommitted and non-pushed changes

#25
post #7
post #6

Earlier quoted context omitted.

I'm curious what the workflow is here. My workflow looks like this: A feature branch is mature enough to get merged into master. So I merge it into master on the staging server. And then push it to the public server.

Yes, so this is useful where deployment is "manual" in the sense that it is not a mere git push. It is bad practice to have git data lying around among otherwise public files, so you have to either set up git hooks on the public server, or fine-tune your public server access rights. Both require (slightly) more work than simply not pushing the git data in the first place.

[deleted]
Post reply on HN