I tried to amend a file and move it to a different folder at the same time but somehow git doesn't track the movement of that file. It sees it as a new file.
christoph@christoph-laptop-16-04-2:~/Documents/Uni/Modules/2016-04-18 Numerik/Vorlesungsfolien$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: Offene Fragen.md
no changes added to commit (use "git add" and/or "git commit -a")
christoph@christoph-laptop-16-04-2:~/Documents/Uni/Modules/2016-04-18 Numerik/Vorlesungsfolien$ git mv Offene\ Fragen.md ..
christoph@christoph-laptop-16-04-2:~/Documents/Uni/Modules/2016-04-18 Numerik/Vorlesungsfolien$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
renamed: Offene Fragen.md -> ../Offene Fragen.md
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: ../Offene Fragen.md
christoph@christoph-laptop-16-04-2:~/Documents/Uni/Modules/2016-04-18 Numerik/Vorlesungsfolien$ git add -A
christoph@christoph-laptop-16-04-2:~/Documents/Uni/Modules/2016-04-18 Numerik/Vorlesungsfolien$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: ../Offene Fragen.md
deleted: Offene Fragen.md
christoph@christoph-laptop-16-04-2:~/Documents/Uni/Modules/2016-04-18 Numerik/Vorlesungsfolien$ git commit -m "Added questions regarding Numerik."
[master a2e17f5] Added questions regarding Numerik.
2 files changed, 4 insertions(+), 2 deletions(-)
create mode 100644 Uni/Modules/2016-04-18 Numerik/Offene Fragen.md
delete mode 100644 Uni/Modules/2016-04-18 Numerik/Vorlesungsfolien/Offene Fragen.md
Is there a way to keep track of a file's movement in such a case? (Other than making 2 commits, of course. Maybe committing once after moving the file and then amending the commit after amending the file would work, too.)