Don't add “+” to linux kernel version

I am building linux kernel, if my kernel under git, then kernel version every time is:

Image Name:   Linux-2.6.39+

If I am not using git, then everything is OK without any plus at the end.

  • Getting rid of “git: /usr/local/lib/ no version information available (required by git)”
  • Git-SVN: Update Git repo from centralized SVN server
  • Pushing fails - Empty repository at remote server with GitKraken
  • Trying to push my Node.js app to Heroku, Error: ENOENT with jade npm
  • Does using Git make sense for small internal teams?
  • Git clone in windows much slower than in linux
  • I know that this done by scripts/setlocalversion script:

    if test "$CONFIG_LOCALVERSION_AUTO" = "y"; then
        # full scm version string
        # append a plus sign if the repository is not in a clean
        # annotated or signed tagged state (as git describe only
        # looks at signed or annotated tags - git tag -a/-s) and
        # LOCALVERSION= is not specified
        if test "${LOCALVERSION+set}" != "set"; then
            scm=$(scm_version --short)

    So, it is possible without code changes say to build system that no need to add “+” at the end of version line?

  • Is a git fetch necessary before git subtree pull?
  • Step back a couple of revisions in git branch
  • git commands as hg commands
  • What does the “diff --git” output in “git diff” refer to?
  • What will happen if I delete a branch on my git repo and someone try to push a commit to it?
  • git.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
  • 2 Solutions collect form web for “Don't add “+” to linux kernel version”

    The plus sign at the end of your version string is there as an indicator that the kernel was built from modified sources (that is, there were non-committed changes). This is also indicated by the comments in scripts/setlocalversion.

    To avoid the ‘+’ being appended despite having a dirty working directory, simply set LOCALVERSION explicityly when running make:


    You may also have to change the configuration option CONFIG_LOCALVERSION_AUTO to n in your kernel config (.config) before building:


    To prevent the script scripts/setlocalversion to append the + to the end of the kernel local version, create an empty .scmversion file in the root of the kernel sources.

    touch .scmversion

    this way, you’ll be able to leave LOCALVERSION as is in the kernel configuration file, in case you want to append a local signature to the kernel name.

    Git Baby is a git and github fan, let's start git clone.