我平时最常用的:
平时使用的向GitHub上传文件
git status # 查看当前版本状态(是否修改)
git add xyz # 添加xyz文件至index
git add . # 增加当前子目录下所有更改过的文件至index
git commit -m 'xxx' # 提交
git commit --amend -m 'xxx' # 合并上一次提交(用于反复修改)
git push origin master # 将当前分支push到远程master分支
删除缓存区中的文件
git rm --cached "文件路径" # 不删除物理文件,仅将该文件从缓存中删除
git rm --f "文件路径" # 不仅将该文件从缓存中删除,还会将物理文件删除(不会回收到垃圾桶)
上传超过100M的大文件
git lfs install # windows平台安装Large File Storage
git lfs track “* .gif” # 这里的 “ *.gif "就是你要上传的大文件
git add .gitattributes # 添加并commit gitattributes文件
git commit -m "Updated the attributes"
git push origin master
git add xxx.gif # 然后再添加大文件到本地缓存区
git commit -m "commits"
git push origin master
git init # 初始化本地git仓库(创建新仓库)
git config --global user.name "xxx" # 配置用户名
git config --global user.email "xxx@xxx.com" # 配置邮件
git config --global color.ui true # git status等命令自动着色
git config --global color.status auto
git config --global color.diff auto
git config --global color.branch auto
git config --global color.interactive auto
git clone g