git | ページ 4 | クズリーマンのカス備忘録

git

スポンサーリンク
git

git 一時的に戻す

やりたいことワーキングツリーの状態を以前のコミットに戻して、以前の状態のファイルを取得したい。やり方■ ブランチを過去のコミットに戻す$ git checkout <コミット名>■ 最新の状態に戻す$ git checkout <ブランチ名...
git

NAS上でgit init したら、fatal: could not set ‘core.filemode’ to ‘false’ が出て、git init できない

環境Windows11の、WSL2の、Ubuntu(シェルはBash)を使用して、マウントしている、SynologyのNAS上でgit init する。事象Windows11の、WSL2の、Ubuntu(シェルはBash)を使用して、マウン...
git

git branch 指定 して clone する

書式git clone -b ブランチ名 URL例git clone -b sub-branch
git

git pull 時に、You can replace “git config” with “git config –global” to set a default preference for all repositories.

事象$ git pullwarning: Pulling without specifying how to reconcile divergent branches isdiscouraged. You can squelch this ...
git

git pull –rebase オプションとは

--rebase オプションをつけてプルしたほうがマージコミットが作られない&履歴が綺麗になる参考ということでした。かわいらしい猫ちゃんの図でとてもわかり易い。ちなみにgit rebaseとはgit rebaseの使いみちだが、上述の参考サ...
git

git head detached 戻す

対応masterブランチしかない場合、masterブランチにする。git checkout master
git

git add 取り消し

基本は、git reset HEAD上記を使うのが多そう。上記を使うのは、 git init 直後でなく、2回目以降のgit addを取り消す ファイルすべて取り消す場合。(両方。AND。)git reset HEADは、git reset...
git

git clone しようとしたら remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.

事象remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead...
git

git merge → git push やり方。サブブランチからメインのブランチ(master, main)などへマージ

やりたいことブランチが以下のように、masterの他に「issue1」というのがあるとする$ git branch  master* issue1issue1を、masterにマージしたい。やり方1. masterブランチにチェックアウトす...
git

git リモートリポジトリの、url 確認は、git remote -v

$ git remote -vorigin (fetch)origin (push)参考qiita
スポンサーリンク