https://wiki.postgresql.org/wiki/Working_with_Git#Using_git_hooks
I want to quickly test my idea (fail fast).
So whatever I changed, committed to the local branch. then I switch to a new branch using
git checkout -b test1
I can quickly get local as latest as remote (master branch) then I do new changes.
How to automate this using git hooks.
https://postgresql.life/post/andrey_borodin/
I think what I do is an antipattern. I have at $HOME directories postgres0, postgres1, postgres2…postgresE, postgresF, postgres10… Whenever I do not understand what I was changing in postgresX - I do git clone https://github.com/postgres/postgres postgresX+1.
Yes, I know git was invented for a reason. But to give a name to the branch I need at least a subtle understanding of what was the purpose of changes.
Basically, when I create a new branch, I can get the latest remote automatically. But before I switch if the old branch doesn't commit, the old branch will be lost? (so I need to prevent this).
I want to make sure every time I use "git checkout -b", the new branch's local content is as fresh as the latest remote. (That means later when I make some change or break something, it's all my fault) also, the previous branch's changes are still there. (I want to automate this).
git checkout -b
**will not delete anything you have written unless you give it a-f
or--force
** option. Also branches are not deleted automatically.