As long as you’re just renaming a file, and not a folder, you can just use git mv:
git mv -f yOuRfIlEnAmE yourfilename
(As of a change in Git 2.0.1, the -f
flag in the incantation above is superfluous, but it was needed in older Git versions.)
More Related Contents:
- How to modify existing, unpushed commit messages?
- Message ‘src refspec master does not match any’ when pushing commits in Git
- How to change the commit author for one specific commit?
- Is there a way to cache https credentials for pushing commits?
- Make the current commit the only (initial) commit in a Git repository?
- Changing capitalization of filenames in Git
- How do I resolve git saying “Commit your changes or stash them before you can merge”?
- Remove files from Git commit
- Removing multiple files from a Git repo that have already been deleted from disk
- How can I make Sublime Text the default editor for Git?
- How can I recover from an erronous git push -f origin master?
- What are the differences between “git commit” and “git push”?
- How to reference the initial commit?
- Recover files that were added to the index but then removed by a git reset
- How to find the commit in which a given file was added?
- git: ‘credential-cache’ is not a git command
- How do I commit only some files?
- How to amend a commit without changing commit message (reusing the previous one)?
- Git excludesfile for a branch
- Removing multiple files from a Git repo that have already been deleted from disk
- override git config –system in .gitconfig user file ( git config –global )
- Commit only part of a file’s changes in Git
- How to change my Git username in terminal?
- How can I revert uncommitted changes including files and folders?
- Remove a git commit which has not been pushed
- Using IntelliJ to amend git commit message
- Telling if a Git commit is a Merge/Revert commit
- Xcode 9 commit: Couldn’t communicate with helper application
- Why does ‘git commit’ not save my changes?
- Is it possible to set a git commit to have a timestamp prior to 1970?