git hell
Moderator: Moderators
git hell
Im trying to meddle around with git, and runnign into issues. As simple as people made it out to be, its not at all. Line endings!!!!! pfft
Right now my ntai/ntai branch is borked,I made a change that resulted in a file turning to all windows line endings. As a result hoijui cant merge with spring master, and I cant fix in another commit, because gitgui knows the file has changed but cant see a differenc ein the content resulting in a never ending loop of rescan -> error dialog -> rescan-> error dialog etc
How do I fix? And how do I prevent it happening again?
Right now my ntai/ntai branch is borked,I made a change that resulted in a file turning to all windows line endings. As a result hoijui cant merge with spring master, and I cant fix in another commit, because gitgui knows the file has changed but cant see a differenc ein the content resulting in a never ending loop of rescan -> error dialog -> rescan-> error dialog etc
How do I fix? And how do I prevent it happening again?
Re: git hell
what's your current git config core.autocrlf?
Re: git hell
that's one of the parts that are broken in git. you need to do switch core.autocrlf to input or false and reset/checkout again.
preventing from happening is easy - once you merged your changes with whatever there is changed, commit the suggested whole-file diff.
Code: Select all
git config core.autocrlf false
git reset --hard OR git checkout back and forth across branches
Re: git hell
hmm should that be set to true not false? I'd done that though I hadnt reset and Id already committed the change to my repo so now theres mixed line endings in one file
Re: git hell
True means it write out crlf all the time. True is very bad.
Where did you commit? The main spring repo or a fork? If just a fork you can alter history a bit and undo that commit.
Where did you commit? The main spring repo or a fork? If just a fork you can alter history a bit and undo that commit.
Re: git hell
Im trying to undo the commit btu I dont know how, Ill set to false
Re: git hell
Okay Im now at the revision where the line endings borked and gitgui shows no changes how do I undo the commit?
Re: git hell
git reset --soft HEAD^
undoes one commit into the working dir
git reset --hard
cleans out the working dir
git push --force
CHECK IN GITK FIRST
undoes one commit into the working dir
git reset --hard
cleans out the working dir
git push --force
CHECK IN GITK FIRST
Re: git hell
It onyl appears to have taken effect locally
Re: git hell
Code: Select all
AF-Standard@AF-PC /d/media/documents/Development/git_repos/ntairepos/ntai
$ git push --force
Everything up-to-date
AF-Standard@AF-PC /d/media/documents/Development/git_repos/ntairepos/ntai
$
Re: git hell
Code: Select all
AF-Standard@AF-PC /d/media/documents/Development/git_repos/ntairepos/ntai
$ git status
# On branch origin/ntai
nothing to commit (working directory clean)
AF-Standard@AF-PC /d/media/documents/Development/git_repos/ntairepos/ntai
$
Re: git hell
Maybe you have to make the new, fixed, commit first.
Re: git hell
so redo my change, change the file to linux endings and commit?
Re: git hell
If you set autocrlf to false, the older version of the file should already have unix endings.
-
- Spring Developer
- Posts: 1254
- Joined: 24 Jun 2007, 08:34
Re: git hell
Wth a little bit of git and dos2unix magic, I commited your change, so you can just drop it and do it right next time.