I m trying to create a script to convert from $GIT_DIR/info/exclude to .gitignore files. I d like to put the .gitignore files as close to the pattern target as possible, meaning that a glob like /a/b/*/*.c
should be put in /a/b/.gitignore
. To do this accurately, I need something which can return the longest substring from the start which is uniquely identified, based on man glob
. Does there exist anything like this, preferably something which is portable across *nixes?
Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...