linux:git

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
次のリビジョン両方とも次のリビジョン
linux:git [2020/02/03 12:35] ともやんlinux:git [2021/03/24 02:12] – [参考文献] ともやん
行 19: 行 19:
  * branch              master     -> FETCH_HEAD  * branch              master     -> FETCH_HEAD
 </code> </code>
 +
 ローカルの master を、リモート追跡の master にリセットする。\\ ローカルの master を、リモート追跡の master にリセットする。\\
 <code> <code>
 $ git reset --hard origin/master $ git reset --hard origin/master
 </code> </code>
 +
 +**Untracked files** を(-d ディレクトリを含めて)削除する。\\
 +<code>
 +$ git clean -df
 +</code>
 +
 +**submodule** の **new commits, modified content** をリセットする。\\
 +<code>
 +$ git submodule foreach --recursive git reset --hard
 +</code>
 +
 +**submodule** の **new commits** をリセットする。\\
 +<code>
 +$ git submodule update --init
 +</code>
 +
 ローカルの状態を確認する。\\ ローカルの状態を確認する。\\
 <code> <code>
行 172: 行 189:
 ===== 参考文献 ===== ===== 参考文献 =====
 [[http://www-creators.com/archives/1097|git pull を強制し、リモートでローカルを上書きする方法 | WWWクリエイターズ]]\\ [[http://www-creators.com/archives/1097|git pull を強制し、リモートでローカルを上書きする方法 | WWWクリエイターズ]]\\
 +[[https://stackoverflow.com/questions/10906554/how-do-i-revert-my-changes-to-a-git-submodule|How do I revert my changes to a git submodule? - Stack Overflow]]\\
 +[[https://stackoverflow.com/questions/26957237/how-to-make-git-clone-faster-with-multiple-threads|How to make git clone faster with multiple threads? - Stack Overflow]]\\
 +shallow clone\\
 +[[https://qiita.com/usamik26/items/7bfa61b31344206077fb|git リポジトリの最新の履歴だけを取得する shallow clone - Qiita]]\\
 +[[https://qiita.com/sonots/items/ce08c30d161ea0b4d5fd|git で shallow clone - Qiita]]\\
 +
  
  • linux/git.txt
  • 最終更新: 2023/09/01 13:18
  • by ともやん