0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

gitメモ

Last updated at Posted at 2020-12-26

環境

Win 10 pro

コンピューター上のすべてのリポジトリについて無視するファイルを設定する

すべてのリポジトリでもvscodeやeclipceのプロジェクトファイルなど共有したくない場合とか

方法(.vscodeのファイルを無視する)

Git Bashを開く

git config --global core.excludesfile ~/.gitignore_global
echo .vscode >> ~/.gitignore_global

状態に戻し仕方

マージする前の状態に戻す

git merge --abort

コミットする前の状態に戻す

git reset --soft HEAD^

ステージングする前の状態に戻す(ステージングを削除、作業は残す)

git rm --cached -r .

改行コードの自動変換について

commit + pushすると、CR+LFな改行コードのファイルをLFに変換
pullするときはLFな改行コードのファイルをCR+LFに変換

基本は

git config --global core.autocrlf true

でいい

リリース作業で想定していない改行コードの不具合を出さないようにするようにgitで自動変換しないようにする

git config --global core.autocrlf false
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?