oh-my-git icon indicating copy to clipboard operation
oh-my-git copied to clipboard

HINT: Index: Adding changes step by step

Open CodeAsm opened this issue 1 year ago • 0 comments

DO NOT use git mv [original] [target name] as this will add the rename to the cached files to be commited.

Us mv instead. or manually change the file name.

I learned to use git mv to rename or move files and this tripped me up in this level so much. i was looking into the sourcecode for any errors. https://github.com/git-learning-game/oh-my-git/blob/main/levels/index/steps#L20 is the exact spot that confused me, what where they checking? well, changes, that are NOT yet been cached or commited: $ git diff --name-only returns 0, nada, if you add them, and git mv emediatly adds them to the cach and commits the changes when you do a single commit (like git add broken_bottle, it ALSO adds the other renamed files if u use git mv)

TLDR: use MV, not GIT MV like i did

CodeAsm avatar Apr 16 '24 09:04 CodeAsm