Sometimes throws a strange error
$ git fresh -f
Fetching origin
remote: Counting objects: 1, done.
remote: Total 1 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (1/1), done.
From github.***:***/***
b5a9630..36fb856 master -> origin/master
Fetching ***
Fetching ***
Fetching ***
Deleted branch *** (was b01d5c1).
Deleted branch *** (was a9f8bb3).
[git-fresh] Error on line 263: fi
interesting. it's not obvious what the problem is.
if you can reproduce it, let me know
Happened again. A bit differently on a clean repo after just simply hitting git fresh -f:
$ git fresh -f
c96ce8f583d4f2cd0353d73571565c79609c6842
warning: ignoring broken ref refs/heads/master.
warning: ignoring broken ref refs/heads/master.
fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
[git-fresh] Error on line 146: fi
I stopped using this script, since after this error I lost all my changes in the repository and the only thing I could do is to start from scratch and clone it out again.
@raszi i've seen this happen where the ref is lost. can you provide details about your OS? i suspect it has something to do with file system conflicts.
your changes are not lost (git-fresh does not do anything destructive by default or with -f flag) - they should still be recoverable.
From the reported issue above I could not get back my repository only by cloning it again unfortunately.
ok @raszi sorry to hear that
can you provide any details about your system? OS, bash version, file system, whether you're the only contributor to the Git repo, etc.
OS: macOS Sierra 10.12.6 (16G29) bash: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin16) fs: hfs
I had multiple remote repositories from multiple contributors.
thanks. i wonder if the "missing master HEAD ref recovery" is causing this issue...i've only ever seen it happen due to file system problems (and fairly crufty Git checkouts), e.g. race conditions between Git and the file system.
without a repro case, this is difficult to diagnose, but i'll keep an eye on it.