git使用笔记

来源:互联网 发布:淘宝阿里旺旺买家版 编辑:程序博客网 时间:2024/06/05 04:27
git 三大部分working tree 工作目录,index file 暂存区,commit 仓库
新增一个文件到staged git add *.txt 提交到head git commit -m "do something"
忽略文件 方法1:目录下新增一个文件 .gitignore *.[oa]
检测文件状态git status
检测文件不同 git diff (-staged|cached)
提交所有文件 git commit -a
创建远程仓库 git remote add bb ""
下载到本地 git fetch bb
合并远程版本到 git merge origin/master git rebase origin/master

向远程仓库push数据后 若远程仓库不为裸仓库 需 git reset --hard 才能看见上一次commit

共享仓库建议使用 git init --bare

git remote set-head 设置远程指向



0 0