ローカルGitブランチ名の変更方法
2023 ワード
https://stackoverflow.com/questions/6591213/how-do-i-rename-a-local-git-branch
Q. How do I rename a local Git branch?
Q.ローカルGitブランチ名の変更方法
How can I rename a local branch which hasn't been pushed to a remote branch?
リモートブランチにプッシュされていないローカルブランチの名前を変更するにはどうすればいいですか?
If you want to rename a branch while pointed to any branch, do:
ブランチを指す場合、ブランチの名前を変更する場合は、次のカーブメソッドを使用します.
現在のブランチ名を変更しようとすると
「-m」オプションは、名前が変更されたことを示します.
Adding an alias could also help.
略語の追加も役立ちます.
To do so, run the following:
ウィンドウまたは他のシステムで、大文字と小文字を変更する場合は-mオプションを使用します.しかし,不適切であれば,支路というエラーが出力される.
Q. How do I rename a local Git branch?
Q.ローカルGitブランチ名の変更方法
How can I rename a local branch which hasn't been pushed to a remote branch?
リモートブランチにプッシュされていないローカルブランチの名前を変更するにはどうすればいいですか?
If you want to rename a branch while pointed to any branch, do:
ブランチを指す場合、ブランチの名前を変更する場合は、次のカーブメソッドを使用します.
git branch -m <oldname> <newname>
If you want to rename the current branch, you can do:現在のブランチ名を変更しようとすると
git branch -m <newname>
A way to remember this is -m
is for "move"(or mv
), which is how you rename files.「-m」オプションは、名前が変更されたことを示します.
Adding an alias could also help.
略語の追加も役立ちます.
To do so, run the following:
git config --global alias.rename 'branch -m'
If you are on Windows or another case-insensitive filesystem, and there are only capitalization changes in the name, you need to use -M
, otherwise, git will throw branch already exists error:ウィンドウまたは他のシステムで、大文字と小文字を変更する場合は-mオプションを使用します.しかし,不適切であれば,支路というエラーが出力される.
git branch -M <newname>
Reference
この問題について(ローカルGitブランチ名の変更方法), 我々は、より多くの情報をここで見つけました https://velog.io/@jsin2475/로컬-Git-브랜치-이름-수정하는-법テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol