Git使用
- 關(guān)聯(lián)本地和遠程倉庫 git remote add <name> <url>
- 查看本地版本 git remote -v
git update-index --assume-unchanged FILENAME 路徑+文件名
git checkout -b newBranch branchA 從branchA拉去新分支newBranch代碼和branchA保持一致不是master
文件在倉庫中存在,但是不想每次修改后就提交(這樣的文件一般是與本機開發(fā)環(huán)境相關(guān)的文件),可以這樣操作:
- 打開.git/config文件
- 增加
[alias]
ignore = update-index --assume-unchanged
unignore = update-index --no-assume-unchanged
ignored = !git ls-files -v | grep "^[[:lower:]]" - 運行 git ignore filename
這樣,再次提交時這個文件的修改就不會被提交徒恋。如果需要再次提交這個文件,運行
git unignore filename