一,git config core.autocrlf false

二,vi .git/config
[remote "origin"]
url = https://github.com/iopqrst/learn20140823.git
[remote "origin"]
url = https://iopqrst@github.com/iopqrst/learn20140823.git

三,cat > .gitignore
#Floder#
bin/
node_modules/
logs/*
==========================
*.a # 忽略所有 .a 结尾的文件
!lib.a # 但 lib.a 除外
/TODO # 仅仅忽略项目根目录下的 TODO 文件,不包括 subdir/TODO
build/ # 忽略 build/ 目录下的所有文件
doc/*.txt # 会忽略 doc/notes.txt 但不包括 doc/server/arch.txt
四, git push https://jianyeruan@bitbucket.org/jianyeruan/kd.git +741c3a6^:master
五,.gitignore只能忽略那些原来没有被track的文件,如果某些文件已经被纳入了版本管理中,则修改.gitignore是无效的。那么解决方法就是先把本地缓存删除(改变成未track状态),然后再提交:
git rm -r --cached .
git add .
六,
git status
git add .
git commit -m 'test'
git commit --amend
git reflog 本地 q退出
git log --oneline 远程
git fetch --all
git pull
git reset --hard xxx
git branch -a //切换分支
git checkout -b dev //创建进入dev
git branch -m devel develop //分支改名
git merge hotfix //把hotfix 合到当前分支
git branch -d hotfix //删除分支
git pull -p //将其从本地版本库中去除
git rm --cached readme.txt 只从stage中删除,保留物理文件
git rm readme.txt 不但从stage中删除,同时删除物理文件
git mv a.txt b.txt 把a.txt改名为b.txt
git push || git push -f[少用为好把本地版本同步到remove]

git push origin dev
git push https://xxxxxxxxxxxxxx

 posted on 2016-11-15 10:32  jayruan  阅读(618)  评论(0编辑  收藏  举报