On Tuesday, August 04, 2020 10:34:59 PM SJW wrote: > I am trying to find a good way to track changes to the db but havn't got it > down pat yet. > > What I am doing > > ``` > git branch feature > git checkout feature > ``` > > modify code and add/modify database tables > ... > create a txt file called feature.txt and list changes. e.g. DB ALTER > statements etc. that I need to apply to staging and production db's
Interesting puzzle ;-) Do you create one file named feature.txt, or do you create a different file for each feature with a unique name? (I'm trying to understand "all these text files" from below.) One thing I'd consider is just having one file named feature.txt, or notes.txt and modify that as appropriate and commit it with each change. Then when you checkout a feature branch, you get the notes (DB ALTER statements) associated with that feature, and it stays associated with that feature branch. You could choose another name for the text file, perhaps: db_alter.txt > ... > > ``` > git add . > git commit -m "Message" > git checkout staging > git merge feature > git checkout master > git merge feature > ``` > > Problem I have is that I have all these txt files that are just notes so I > delete them but they keep reappearing ( because I merged them into master > and then create new branch etc. ) > > I found this was a bit annoying so I stopped adding and committing the txt > files but now I have these txt files sitting in the unstaged changes area > of all projects - not a great idea either. > > Any suggestions on how to better manage these notes and somehow ensure they > remain linked to each feature branch? > > Thanks