s9y/Serendipity — comment on commit 8df9df2183b41dee67d47b603a56f30dac8f6e99
File:  line 0
By ophian:

l solved my issues, as I realized that my local branch was fully set back to the branch state (in this case 1.6).
I opened the news file and corrected these errors and commited. Everything fine.

I paste my (slightly commented) bash history here - to show how this happened to work - maybe there is a faster and cleaner solution doing this and someone more skilled in these things can show how to do this any better, please, as this seems quite complicated to me.

(master)
$ git pull origin master

(master)
$ git checkout -b 1.6 origin/1.6
Switched to a new branch '1.6'

(1.6)
$ git cherry-pick "commit-number"

(1.6)
$ git pull

(1.6)
$ git push

(1.6)
$ git checkout origin/master
Checking out files: 100% (835/835), done.
Note: checking out 'origin/master'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

git checkout -b new_branch_name

HEAD is now at 6d4bd49... 'the last commit note'

**And here is how to get out the 'detached HEAD' state mode:**

((6d4bd49...))
$ git checkout -b temp
Switched to a new branch 'temp'

(temp)
$ git checkout temp
Already on 'temp'

(temp)
$ git diff master temp

(temp)
$ git diff origin/master temp

(temp)
$ git branch -f master temp

(temp)
$ git checkout master
Switched to branch 'master'

(master)
$ git branch -d temp
Deleted branch temp (was 6d4bd49).