this post was submitted on 29 Jun 2023
11 points (100.0% liked)

Git

2632 readers
2 users here now

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Resources

Rules

  1. Follow programming.dev rules
  2. Be excellent to each other, no hostility towards users for any reason
  3. No spam of tools/companies/advertisements. It’s OK to post your own stuff part of the time, but the primary use of the community should not be self-promotion.

Git Logo by Jason Long is licensed under the Creative Commons Attribution 3.0 Unported License.

founded 1 year ago
MODERATORS
 

We all have been there... For the beginner it's easy to mess things up. What are your horror stories with Git?

Link to xkcd

you are viewing a single comment's thread
view the rest of the comments
[–] whats_all_this_then@programming.dev 0 points 1 year ago* (last edited 1 year ago) (1 children)

I've had a similar issue before and the problem was that I had made the repo on linux, worked on it a bunch, copied it over to a different PC running windows, then copied it back. Found this on stackoverflow and it fixed it for me, but I've only tested it on linux (probably won't work on windows because grep). Hopefully it helps:

git diff -p -R --no-ext-diff --no-color | grep -E \"^(diff|(old|new) mode)\" --color=never | git apply

[–] JackbyDev@programming.dev 1 points 1 year ago

That's the weird thing, everyone here uses Mac and the server running the template is Linux so this isn't a case of a Windows user forgetting to set autocrlf and even then it is in the git attributes file.