Git操作

Git

git 工作原理

img

初始化

Cloning from a remote repository to a local repository

1
2
3
git clone http://git.skytech.cn/Digger/dolphinscheduler.git

git init

分支操作

创建查看并切换分支

1
2
3
4
5
git branch test

git branch -v

git checkout test

切换版本

1
git reset --hard 版本号

拉取合并分支到当前分支=拉取分支并合并

1
2
3
4
5
git fetch origin master
+
git merge dolphinscheduler
||
git pull origin dolphinscheduler:dolphinscheduler

切换分支版本

1
git reset --hard 版本号

提交

添加到暂存区->提交到 local repository->选择远程库并提交

1
2
3
4
5
git add 文件名

git commit -am "日志信息" 文件名

git push 别名 分支

查看远程库

1
git remote -v

添加远程库

1
git remote add 别名 远程地址

强制push

1
git push 别名 分支 -f

其他

多人项目,拉取代码后同事又修改代码上传,先拉后推

1
2
3
4
5
git pull origin dolphinscheduler:dolphinscheduler

git add ./*

git push origin dolphinscheduler

idea中操作git

Donate
  • Copyright: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.

扫一扫,分享到微信

微信分享二维码
  • Copyrights © 2020-2021 ycfn97
  • Visitors: | Views:

请我喝杯咖啡吧~

支付宝
微信