Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save orangecms/09e7168db4d23a40f2c39179c92cb8e9 to your computer and use it in GitHub Desktop.
Save orangecms/09e7168db4d23a40f2c39179c92cb8e9 to your computer and use it in GitHub Desktop.
A simple one-liner to get the current branch name in your Linux kernel `.config` 🎉
#!/bin/bash
sed -i "s/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=\"$(git branch | grep "*" | cut -b 3-)\"/" .config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment