Tag: file rename

Git gets renames (a swap) of files wrong. How to merge them automatically?

I have file which is is being edited on some branch, and in my branch I swap its name with some other file. Git will report merge conflict on both files and produces wrong diff. Is it possible to avoid result like one below without undoing the renames before every time I merge? $ git […]

How can I get git to show me changes on an individual renamed file

If I do git difftool -y –find-renames master I get diffs of any file with the original version on the branch, so if I’ve renamed ‘a’ to ‘b’ and changed it, I get the differences between the current ‘b’ and the original ‘a’. But if, instead, I do git difftool -y –find-renames master b it […]

How do I do commit a renamed file with case-sensitive using TortoiseGit?

I am trying a sample project to rename a file using Eclipse. First, I did a commit and pushed to GitHub. The file was Samplemain.java. If I rename that file to SampleMain.java and if I try to commit the renamed file using TortoiseGit, I’m unable to commit. Instead, it’s showing an error with a small […]

Git rename detection of empty file

I recently hit a problem where an empty file was renamed differently in two branches but merged without a conflict being raised. Steps to recreate are as follows. Create an empty file. git init touch empty git add empty git commit -m “add empty file” Rename it in the branch. git checkout -b branch git […]

Renamed files inside git

I am a new programmer in a team. And at my first day I have this renamed file inside a stage, ready to be committed by git: $ git status On branch master Changes to be committed: (use “git reset HEAD <file>…” to unstage) modified: .gitignore new file: reports/SQLS.rar renamed: account/enter_rules.php -> enter_rules.old.php Changes not […]

Create Git patches for two files across several renames

I want to move two files from one repository to another. The files were originally added as: /src/init/Price.cs /tests/init/PriceTests.cs The two files were later renamed to: /src/init/PriceValue.cs /tests/init/PriceValueTests.cs And then moved to: /src/moved/PriceValue.cs /tests/moved/PriceValueTests.cs I’ve tried to go by this description to create a set of patches for these files, but I’m unsure how to […]

Git on windows: Can't switch branch after renaming a file (only changed case)

I’m working with git on windows, and I have a file in my repo, lets say “foo.txt”. Today I wanted to rename this file to “Foo.txt” (uppercase). As suggested in this SO question, I used git mv -f foo.txt Foo.txt, which produced the desired result. I proceeded to commit the change to my repo. EDIT: […]

How to stage a rename without subsequent edits in git?

I have a file that I’ve renamed and then edited. I would like to tell Git to stage the rename, but not the content modifications. That is, I wish to stage the deletion of the old file name, and the addition of the old file contents with the new file name. So I have this: […]

Getting Git to follow renamed and edited files

Questions about renaming files in Git have been asked before, but I can’t work out a solution to my specific problem. I have moved and edited multiple files (I didn’t use git mv – unfortunately it’s now too late for that). Now I want it so when my colleague pulls from my repository, having made […]

Changing capitalization of filenames in Git

I am trying to rename a file to have different capitalization from what it had before: git mv src/collision/b2AABB.js src/collision/B2AABB.js fatal: destination exists, source=src/collision/b2AABB.js, destination=src/collision/B2AABB.js As you can see, git throws a fit over this. I tried renaming using just the plain old mv command as well but git doesn’t pick up the rename (as […]

Git Baby is a git and github fan, let's start git clone.