生成 git 的key:
利用windows PowerShell 命令生成key:
ssh-keygen -t ed25519 -C "your_email@example.com"
1、从git上down项目:
git clone git服务器地址
如:git clone git@codeup.aliyun.com:
注:会有提示,一路yes——ok
remote address
查看远程分支
git branch -v
查看所有分支
git branch -a
创建本地分支
git branch local_branch_name
切换本地分支
git checkout local_branch_name
创建并切换到本地分支
git checkout -b local_branch_name
删除本地分支
git b
tag
# 查看
git tag
git show <tag_name>
# 创建
git tag -a v201909 -m "这里是说明"
git tag v201909
# 删除
git tag -d v201909
# 以前的commit 打标签
git tag -a v201903 9fcec02
# 推送
git push orgin <tag_name>
git push origin --tags
# 同步所有tag
git fetch
Branch
查看远程分支
git branch -v
查看所有分支
git branch -a
创建本地分支
git branch local_branch_name
切换本地分支
git checkout local_branch_name
创建并切换到本地分支
git checkout -b local_branch_name
删除本地分支
git branch -d local_branch_name
推送本地分支到远程
git push origin <local_branch_name>:<remote_branch_name>
删除远程分支
git push origin :<remote_branch_name>
克隆远程指定分支
git clone -b <branch_name> --single-branch <repo_name>
git clone -b dashed_3.0 --single-branch http://192.168.10.90/server/transfer.git
迁出远程分支到本地
git checkout -b <local_branch_name> <remote_branch_name>
git checkout -b dashed_3.0 origin/dashed_3.0
合并指定分支到本地当前分支, local_branch_name2合并到local_branch_name1
git checkout <local_branch_name1>
git merge <local_branch_name2>
拉取远端origin/master分支并合并到当前分支
git pull origin master