1. 症状
git rebase を実行したときに Non Fast-Forward ( --no-ff
) のマージコミットが消える。分岐や合流のない一本の直線的なコミットにまとめてしまう。
git rebase を実行したときに Non Fast-Forward ( --no-ff
) のマージコミットが消える。分岐や合流のない一本の直線的なコミットにまとめてしまう。
1 |
$ git worktree add チェックアウトパス名 コミット |
1 |
$ git worktree add ~/Projects/LocalMaster master |
「やり直し系コマンド」は私の造語です。gitの操作は常にやり直せます。
「打ち消す」、「リセットする」、「削除する」、「クリーンする」など、「やり直す」ためのgitのコマンドやオプションを紹介します。
続きを読む
リモートリポジトリのブランチの削除を試みると fatal が発生する。
1 2 3 4 |
$ git push origin :my_branch remote: fatal: bad object 0000000000000000000000000000000000000000 To https://github.com/JaneDoe/my_repository - [deleted] my_branch |
過去の特定のコミットからブランチを作成する方法
1 |
git checkout <rev> -b <branchname> |
1 |
$ git checkout 6bf73e8 -b my_new_branch |
1 |
$ git tag タグ名 |
1 |
$ git tag v.1.10 |
フォルダを移動した/リネームしたファイルの履歴が(通常操作では)途切れる。
--follow
オプションを付加する
Continue listing the history of a file beyond renames (works only for a single file).
Git において、日本語のファイル名やパス名が化ける。
1 2 3 4 5 6 7 8 9 10 |
$ git status On branch master No commits yet Untracked files: (use "git add <file>..." to include in what will be committed) "\343\201\212\350\252\255\343\201\277\343\201\217\343\201\240\343\201\225\343\201\204.txt" nothing added to commit but untracked files present (use "git add" to track) |