Git常用命令整理

git init

git status //查看仓库状态

git add @filename// 跟踪指定文件

git add . //添加所有文件到暂存区

git commit -m "description" //提交并描述

git remote add @shortname http://git... //工作目录关联到远程仓库

git pull @shortname master(branch name) //拉取远程仓库并合并到当前master分支,下一步要提交

git push @shortname master(branch name) //推送

git remote show @shortname //查看远程仓库

git tag -a v1.3 e4bf49a2 -m "第二次提交" //后期打标签

git push myTest v1.3 //同步到远程仓库

git branch @name//当前提交对象上创建分支

git log --oneline --decorate//查看各个分支当前所指对象

git checkout testing//分支切换

git remote update origin --prune //更新远程分支列表

git diff --name-only `git merge-base 9a86b1d master`..9a86b1d > d:/files.txt //Git检索分支中修改的所有文件的列表

git diff --name-only 63404fd 1d2eb8d --stat > d:/files.txt //获取两次提交之间修改的文件列表

posted @ 2020-04-28 14:53  迷途小书童F  阅读(90)  评论(0)    收藏  举报