目次
文書の過去の版を表示しています。
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
トラブルシューティング
編集もしていないのにステータスで確認すると modified: が出続ける
$ 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