Struts2 入門 Localization
vim で BOMを表示する
-b オプションで表示可能
vim -b foo.txt
Git リモートリポジトリとのやり取り
remoteと差があるか確認する
- git remote show origin でチェック可能
- 実行結果の最終行「master pushes to master (xxx)」のxxxの部分が
local out of date | localが旧い(fetch/pullすべき) |
fast-forwardable | localが新しい(pushすべき) |
git remote show origin ## log * remote origin Fetch URL: https://foo@${url}/foo/testing.git Push URL: https://foo@${url}/foo/testing.git HEAD branch: master Remote branch: master tracked Local branch configured for 'git pull': master merges with remote master Local ref configured for 'git push': master pushes to master (fast-forwardable)
remote のリポジトリのデータを取得する (作業領域に影響なし)
- git fetch で実行可能
- fetchしてきたデータは.git/FETCH_HEADに保存される。なお、このデータはmerge後にも残る
git fetch # log remote: Counting objects: 7, done. remote: Compressing objects: 100% (3/3), done. remote: Total 4 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (4/4), done. From https://xxx.com/foo/testing 96f668a..17c7a88 master -> origin/master
git diff FETCH_HEAD git diff --name-status FETCH_HEAD git difftool FETCH_HEAD # fetch 直後の場合、FETCH_HEAD は origin/master でも同じ
- fetch 結果を merge
git merge FETCH_HEAD # Log:問題ない場合 Updating 0ab3cb6..96f668a Fast-forward index.html | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) # Log:confrictしてる場合 Auto-merging index.html CONFLICT (content): Merge conflict in index.html Automatic merge failed; fix conflicts and then commit the result.
remote のリポジトリデータを取り込み、マージする
- git pull を使うと 上記のgit fetch / merge の流れを一度で行える
git pull ## log Updating 3f4bbc6..0ab3cb6 Fast-forward index2.html | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 index2.html
Git プロジェクトのチェックアウト
チェックアウトには clone コマンドを使う
git clone https://${user_name}@foo/testing.git
Git .gitignoreで無視するファイルを決定できる
- .gitignore という名前でテキストファイルを作ればOK