Answer the question
In order to leave comments, you need to log in
How to remove these lines in git?
I don’t remember what happened and when, but now these lines constantly fall out when git checkout master.
Apparently they are marked for deletion, but I, as an inexperienced user, do not know what to do with them next, tell me, plz.
Answer the question
In order to leave comments, you need to log in
git add -A try it. It might help. Git himself seems to talk about it even.
"warning: You ran 'git add' with neither '-A (--all)' or '--ignore-removal',
whose behavior will change in Git 2.0 with respect to paths you removed.
Paths like ' *path* ' that are
removed from your working tree are ignored with this version of Git.
* 'git add --ignore-removal *pathspec*', which is the current default,
ignores paths you removed from your working tree.
* 'git add --all *pathspec*' will let you also record the removals.
Run 'git status' to check the paths you removed from your working tree."
I always get this if something is deleted.
There is also git reset HEAD *file* - this pulls files out of the commit. Those. they generally go out of the current tracking and will not be taken into account next time, even if you change them.
Just be careful with this. And then you will break half of the project, then you will have to roll back. First, figure out that the remote is unnecessary, otherwise something necessary has been deleted. If you send this commit, then everything will be synchronized both in the repository and on the combat server. If you work in a team, you can get a hat from colleagues.
Спасибо, git add --all решило проблему. Хотя изначально попробовал git add -A, но забыл, что результат будет виден после коммита и сходу сделал --all. Так что может и -A отработало.
А вообще, обычно добавлял через git add . (точка)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question