Can't discard changes in git
meaning of can in hindi
A week or two ago I took some files that I had been archiving with a simple
find |sed|tar|xz|gpg bash script, unpacked them all, and put their contents in a git repo, commited, put the next archives content in the repo, committed (rinse and repeat) in order to have a nicer system.
All files were edited with on one of my two computers, both using Arch Linux, in either TeXstudio or Vim.
I tried to checkout an old version, but its flipping out---it won't let me due to changed that are outstanding. I tried everything I knew how, and then went on Google to find out things I didn't know.
There are a number of other questions on this subject. Unfortunately their answers have not helped me. For sake of completion I'll list the questions.
$ git status On branch master Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory)
modified: Arcs/arc1.tex modified: Arcs/arc2.tex modified: Arcs/frontmatter.tex
no changes added to commit (use "git add" and/or "git commit -a")
Also, so people don't need to look, below, I already did the obvious ones.
git reset --hard git -a commit git stash git pull
as well as remove everything from the index and add it back.
Cant discard file changes in GIT
I'm not on Windows. Also, this should have anything to do with line endings since I'm the only user. There is no reason for there to be weird line endings.
Git refuses to reset/discard files
git reset --hard HEAD (among other possibilities)
git stash git stash drop
git config core.autocrlf input git rm --cached -r . git reset --hard git add . git commit -m "Normalize line endings"
Not only did this not work but it increased the number of files that are misbehaving and also wrote 700+ lines to a file for. . .reasons. It wasn't even the file that was misbehaving.
Can't seem to discard changes in Git
More end line stuff.
How do I discard unstaged changes in Git?
git clean -df git checkout -- . git checkout -- ./. git checkout-index -a -f git checkout --force master
Things I didn't see, but tried anyway
I tried commiting the changing
git commit -am "WORK DAMN YOU!" then
git revert --hard HEAD^
I also tried pulling from my private remote, but was just told that the local repo was already up to date.
This is extremely frustrating.
CAN (noun) definition and synonyms, contains food, but not if it contains a drink. empty beer cans. Create beautiful designs with your team. Use Canva's drag-and-drop feature and layouts to design, share and print business cards, logos, presentations and more.
git rm --cached -r .
git reset --hard
That was the only solution that worked for me. Hope it will help somebody!
What does CAN mean? - CAN Definition, Can may refer to: Contents. 1 Containers; 2 Music; 3 Other; 4 See also. Containers. Aluminum can · Drink can · Oil can · Steel and tin cans · Trash can Can definition, to be able to; have the ability, power, or skill to: She can solve the problem easily, I'm sure. See more.
git config --global core.autocrlf true
Can dictionary definition, Can was the leading avant-garde rock group of the 70s. Can experimented with noise, synthesizers, non-traditional music, cut-and-paste techniques, and, most Define can. can synonyms, can pronunciation, can translation, English dictionary definition of can. to be able to, have the power or skill to: I can take a bus to the
Can, VerbEdit. can (third-person singular simple present can, present participle -, simple past could, past participle (obsolete except in can definition: 1. to be able to: 2. used to say that you can and will do something: 3. to be allowed to: . Learn more.
Can, can meaning: 1. to be able to: 2. used to say that you can and will do something: 3. to be allowed to: . Learn more. 110 synonyms of can from the Merriam-Webster Thesaurus, plus 97 related words, definitions, and antonyms. Find another word for can. Can: to bring (as an action or operation) to an immediate end.
Can, Could is used as the past tense of can when it means that someone had the ability to do something, or that something was possible: New York was a place Create beautiful designs with your team. Use Canva's drag-and-drop feature and layouts to design, share and print business cards, logos, presentations and more.
- You've told us everything except what we really need to see, which is the output from
git statusat the very beginning when the problem began. Can you include the original output from
- I omitted it since it seemed pretty banal. However, its up there now.
- You have several options here. If you don't want those changes, you may do
git reset --hardto discard them. If you do want the changes, then either follow Git's advice and
git addfollowed by
git committhem, or you can do a
- I already did all of those.
- Then I suggest that you made a mistake along the way. The options I suggested all should have worked.
- As mentioned that doesn't work. The copy stored in the repo is going to be different from the working copy due to filters. You can remove/replace the files all you want and in any way you want, but they will always disagree with what is stored in the commit.