bitbucket - Git: unable to create symlink (File name too long) -
i had pushed project linux bitbucked , cloned on windows. turns out there 2 symlinks, appeared textfiles on windows. since knew should point to, replaced them copies of destination files, committed , pushed.
now butbucket repository looks okay when it web interface. git clone on unix machine gives me 2 messages like:
error: unable create symlink ... (file name long)
and 2 files, symlinks absent. tried cloning /tmp/... shorter filenames, got same results. suggests, went bad bitbucket repository. tried core.symlinks
on , off.
i can live without symlinks, i'd have working repository. know way (other recreating repository)?
as changed content of fake-symlink-file without changing mode symlink regular file , committed result, made blob can't extracted on os real symlinks, because have object supposed symlink content long pathname. web interface not doing favors hiding problem.
you're going have commit, fix it, , re-commit after it. git rebase -i
help, still might not easy, if you've made more changes files while in bogus symlink-but-not-really-a-symlink state.
supposing bad commit abcdef123
, need this:
git rebase -i 'abcdef123^'
which put in editor list of commits. abcdef123
should on first line. on line, change pick
edit
. if there more 1 bad commit, change of them edit
. save , exit editor.
now you'll in point in time committed bad file. chance alter history, putting things right once went wrong. inspect commit with
git show
and undo bad part restoring original symlink pathname file , git add
ing it. or rid of symlink git rm
, create new file , git add
that. if choose first option, aware content of symlink pathname. it's not text file - doesn't have newline on end. if edit text editor adds newline, you'll have broken symlink (pointing file newline in name).
after you've done git add
, reinsert fixed commit place in history:
git commit --amend git rebase --continue
if changed multiple commits pick
edit
you'll have repeat procedure each one. final git rebase --continue
bring present.
if @ past commit during rebase , discover whole commit bad (it did nothing else besides replacing symlink unmodified content of file points to), can git rebase --skip
instead of amending , continuing. if know ahead of time going happen, can delete bad commit git rebase -i
list instead of changing pick
edit
.
if have multiple branches affected bad commit(s), have repeat whole procedure each branch. check out branch, run git rebase -i
completion (which when git rebase --continue
says "successfully rebased"), check out next branch , again.
in future, when splitting development work between windows , real os, windows work cygwin. inside cygwin, symlinks symlinks , can't mess them did.
Comments
Post a Comment