Skip to content

Instantly share code, notes, and snippets.

@nikolaDrljaca
Last active September 13, 2023 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikolaDrljaca/afc1fcb541027910f4740961482f9103 to your computer and use it in GitHub Desktop.
Save nikolaDrljaca/afc1fcb541027910f4740961482f9103 to your computer and use it in GitHub Desktop.
Shell script to ignore yaml files in resources folder for Spring(Boot) projects
#!/bin/bash
# Add all changes to a commit EXCEPT the changes in application.yaml files inside resources directory
# Can also be used as an alias, in which case a separator command would be used
# alias gadd="git add . :^src/**/resources/**.yml :^src/**/resources/**.yaml; git status"
# The alias should reside in the .bashrc file.
git add . :^src/**/resources/**.yml :^src/**/resources/**.yaml
git status
## Alternatively, use git add -p for a more interactive experience where diffs from each file can be seen
## and added individually, thus forcing you to catch the changes in application yaml files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment