目录
git提交更新代码步骤如下:
1、右击 Git Bash Here
2、切换路径到自己本地代码下
3、查看分支情况,默认在master分支下
4、切换到自己创建的dev分支下
5、kafka是我之前已经提交保存的代码目录
6、创建zookeeper,并将写好的代码放置在该目录下。
7、提交代码
8、提交描述,将文件提交到仓库
9、推送代码
10 、可以在该地址下查看自己的推送的代码。
git提交更新代码步骤如下:
1、右击 Git Bash Here ?
进入git操作页面。(此处不方便截图)
2、切换路径到自己本地代码下
kl1210@CNHQ-kl1210N MINGW64 /d/Users/Desktop/git/dev (dev)
$ cd git/snb/test/
3、查看分支情况,默认在master分支下
kl1210@CNHQ-kl1210N MINGW64 /d/Users/Desktop/git/dev (dev)
$ git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
4、切换到自己创建的dev分支下
kl1210@CNHQ-kl1210N MINGW64 /d/Users/Desktop/git/dev (dev)
$ ?git checkout ?dev
Switched to branch 'dev'
Your branch is up to date with 'origin/dev'.
5、kafka是我之前已经提交保存的代码目录
kl1210@CNHQ-kl1210N MINGW64 /d/Users/Desktop/git/dev (dev)
$ ll
total 4
drwxr-xr-x 1 kl1210 test ?0 ?3月 25 15:03 kafka/
6、创建zookeeper,并将写好的代码放置在该目录下。
kl1210@CNHQ-kl1210N MINGW64 /d/Users/Desktop/git/dev (dev)
$ mkdir zookeeper
7、提交代码
(一定要在默认目录下执行)
kl1210@CNHQ-kl1210N MINGW64 /d/Users/Desktop/git/dev (dev)
$ git add zookeeper
warning: LF will be replaced by CRLF in zookeeper/zk_connection.sh.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in zookeeper/zk_process.sh.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in zookeeper/zk_role.sh.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in zookeeper/zk_syncfollower.sh.
The file will have its original line endings in your working directory
8、提交描述,将文件提交到仓库
kl1210@CNHQ-kl1210N MINGW64 /d/Users/Desktop/git/dev (dev)
$ git commit -m "上传zookeeper脚本"
[dev 7ef5973] 上传zookeeper脚本
?4 files changed, 256 insertions(+)
?create mode 100644 zookeeper/zk_connection.sh
?create mode 100644 zookeeper/zk_process.sh
?create mode 100644 zookeeper/zk_role.sh
?create mode 100644 zookeeper/zk_syncfollower.sh
9、推送代码
代码提交之后,在本地的工作就已经完成了。如果希望其他人也能拉取你的代码,通常还需要将代码推送到远程仓库。
kl1210@CNHQ-kl1210N MINGW64 /d/Users/Desktop/git/dev (dev)
$ git push
Enumerating objects: 8, done.
Counting objects: 100% (8/8), done.
Delta compression using up to 4 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 2.34 KiB | 1.17 MiB/s, done.
Total 7 (delta 4), reused 0 (delta 0), pack-reused 0
remote: reposName:test groupName:testgroup branchname:dev
remote: ? % Total ? ?% Received % Xferd ?Average Speed ? Time ? ?Time ? ? Time ?Current
remote: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Dload ?Upload ? Total ? Spent ? ?Left ?Speed
remote: 100 ? ? 1 ?100 ? ? 1 ? ?0 ? ? 0 ? ?111 ? ? ?0 --:--:-- --:--:-- --:--:-- ? 100
remote: Fri Mar 25 15:09:20 CST 2022 send suc
remote:
remote: To create a merge request for dev, visit:
remote: ? http://git.test.com/test/-/merge_requests/new?merge_request%5Bsource_branch%5D=dev
remote:
To http://git.test.com/test.git
? ?d183cfd..7ef5973 ?dev -> dev
10 、可以在该地址下查看自己的推送的代码。
(因为不是自己电脑,git.test.com、test这些都是修改后的,结构类似,大家可以类比)
http://git.test.com/test/-/tree/dev
|