linux:git

文書の過去の版を表示しています。


Git - 分散型バージョン管理システム

$ git pull
Already up to date.

リモートの最新を取ってくる。

$ git fetch origin master
From git://git.tomoyan.net/project_name
 * branch              master     -> FETCH_HEAD

ローカルの master を、リモート追跡の master にリセットする。

$ git reset --hard origin/master
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   .eslintignore
	modified:   .eslintrc
	modified:   .github/PULL_REQUEST_TEMPLATE.md
	modified:   tool/unicode.js
	modified:   tool/update_deps.js
	modified:   tool/wrap_keyword_regexp.js

no changes added to commit (use "git add" and/or "git commit -a")

編集を破棄する為に以下を実行してもステータスで確認すると modified: が出続ける。

$ git checkout .
$ git checkout -- *
$ git reset --hard origin/master

差分を確認するとファイルパーミッションの変更まで検知している。

$ git diff .eslintignore
diff --git a/.eslintignore b/.eslintignore
old mode 100644
new mode 100755

解決策はファイルパーミッションの変更を無視する。

$ git config core.filemode false
$ git config -l
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
remote.origin.url=git://github.com/ajaxorg/ace.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
  • linux/git.1566167139.txt.gz
  • 最終更新: 2019/08/19 07:25
  • by ともやん