Git和Repo使用命令

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_26366149/article/details/79825192
git

git init:创建一个含有工作区的仓库

git init --bare:创建一个初始化的仓库,这个仓库没有工作区,通常用于服务器端

git clone url [destdir]

git add file

git status

git commit -m "message"

git reset --hard hash|HEAD^:回退本地仓库,工作区,Index

              --soft :回退本地仓库

HAED:当前指针

git checkout -- file 检出文件

git checkout branchname

git branch newbrnach

git branch -d branch

git rm file

git cherry-pick hash:检出到当前分支

git pull url

git merge

git log --oneline

git log -n n:

git diff :工作区和Index

git diff --[staged|cached]:本地仓库和index


git

Repo

repo init url

repo sync -c -d:同步当前分支当前目录

repo sync dir:同步指定目录








猜你喜欢

转载自blog.csdn.net/qq_26366149/article/details/79825192
今日推荐