
git clone https://github.com/raikay/gittest.git git pull git add 文件名 # 指定文件。 git add . # 将当前工作区的所有文件都加入暂存区 git commit -m "提交说明" git commit --amend #追加 /修改上次提交、不新增提交记录 git status git push git push origin branch1 #多个仓库时,指定 origin 仓库下 branch1 分支 git 命令 -h // 从远程仓库下载最新版本 git fetch -all // 将本地设为刚获取的最新的内容 git reset --hard origin/master git init git add . git commit -m 'init' git remote add origin https://github.com/raikay/gittest.gitgit push -u origin master
-u:创建 upStream 上传流,只在初次推送代码时创建,以后就不用加-u参数了
git 命令备忘系列(一):基础命令
git 命令备忘系列(二):配置文件操作( config )
git 命令备忘系列(三):查看历史记录( log )
git 命令备忘系列(四):对比两个分支的差异( diff )
git 命令备忘系列(五):恢复与撤销( reset )
git 命令备忘系列(六):分支操作( branch )
git 命令备忘系列(七):标签操作( tag )
git 命令备忘系列(八):使用技巧集合