Re:Minimum Viable Git for Trunk-Based Development
by TrickyRick on Wednesday November 30, 2022 @12:37PM
(#33804316)
Sure but it goes in the repo. Forgot to add .env to the .gitignore? You probably just committed a secret. Sure you can force push to get rid of it but if you're using Github it's still saved so it needs to be rotated now.
[ Parent
| on HN ]
Re:Minimum Viable Git for Trunk-Based Development
by alkonaut on Wednesday November 30, 2022 @02:12PM
(#33805989)
What’s “the repo” here? What I commit goes into my copy of the repo. Only what I push goes into any repo anyone else sees. Before pushing I always go through what’s in the branch and clean up/rebase etc. Sure it’s easier to accidentally push a file you shouldn’t have if you have added it locally but committing alone doesn’t necessarily mean you need to rotate a secret.
Re:Minimum Viable Git for Trunk-Based Development
by LocalPCGuy on Wednesday November 30, 2022 @04:41PM
(#33808174)
That is a case where (as you note) you'd need to do some sort of destructive fix to eliminate the file from your local repo. Whether it's a rebase or something else, a person then needs to know "the advanced parts" that the blog post is advocating aren't really needed if "git is done correctly". Better to just not commit files/hunks accidentally in the first place - I know, it's not a perfect world, yada yada - just trying to provide the counter point to the counter point.
Re:Minimum Viable Git for Trunk-Based Development
by alkonaut on Wednesday November 30, 2022 @04:57PM
(#33808401)
Yeah I’d say interactive rebase and soft resets is part of my “limited toolbox” for git that I wouldn’t go without. (I don’t stage hunks, don’t merge in either direction etc, so I leave some other parts of the larger toolbox alone).