0
$\begingroup$

I need to search in the git history of a couple of packages to get back to a working state for a demo. I am searching by checking out commits manually until I found the commits of all effected packages that work together.

By checking out commits manually, I will get into the detached HEAD state:

$ git checkout 995e018 -> You are in 'detached HEAD' state. [...]

To save the current state of all packages, a snapshot is created:

$ autoproj snapshot demo_working

Now the demo_working/overrides.yml will pin the commit where the HEAD is pointing to (e.g. 5e2e3a259) instead of the commit that I chose manually for the package (995e018).

Is this the desired behaviour? In my opinion a snapshot should store the current state of all my git repositories meaning that I can also select commits manually.

$\endgroup$
1
  • $\begingroup$ For future reference, you can binary search the last commit where a condition was satisfied (e.g. before a bug was introduced, or while everything still worked) using git bisect $\endgroup$
    – Shahbaz
    Jun 25, 2014 at 12:12

1 Answer 1

1
$\begingroup$

Working with git HEADs is just a bad idea, so yes, this behaviour is expected.

What you want to do is reset your current branch to the desired commit, i.e.

git reset --hard 995e018

which will be picked up by autoproj

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.