Skip to content

Instantly share code, notes, and snippets.

@k8scat
k8scat / delete_git_submodule.md
Created May 11, 2021 03:45 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@k8scat
k8scat / extract-credentials.groovy
Created April 13, 2021 08:22 — forked from pedrohdz/extract-credentials.groovy
Export credentials for Jenkins Configuration as Code (JCasC)
// This Jenkins Groovy script extracts credentials in Jenkins and outputs them
// in a JSON format that can be digested by "Jenkins Configuration as Code".
// Just pass the output into a JSON to YAML converter. You can run this
// through the Jenkins Script Console or similar.
//
// Thank you:
// - https://github.com/tkrzeminski/jenkins-groovy-scripts/blob/master/show-all-credentials.groovy
//
// To conver to YAML `json2yaml | sed '/^[[:space:]]*$/d'`
//