新建仓库,将代码加入
gitee根据提示创建仓库
填写完成后
创建readme文件,目的为了初始化分支。
现在按照下面命令操作
#进入本地项目文件夹
cd xxx
git init
git remote add origin https://gitee.com/zcjlq/test1.git
git pull
git add xxx
git commit -m "xxx"
git push
已有gitee仓库,将本地代码加到新分支
克隆gitee仓库到本地
PS D:\1_dev\UDPSender> git clone https://gitee.com/zcjlq/test1.git
Cloning into 'test1'...
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (4/4), 2.07 KiB | 265.00 KiB/s, done.
PS D:\1_dev\UDPSender> cd .\test1\
PS D:\1_dev\UDPSender\test1> git checkout -b test_branch
Switched to a new branch 'test_branch'
将本地代码粘贴到test1目录
把需要添加到git仓库的文件加入
PS D:\1_dev\UDPSender\test1> git add .\dispersion\
warning: LF will be replaced by CRLF in dispersion/dstIpPool.txt.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in dispersion/dstPortPool.txt.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in dispersion/srcIpPool.txt.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in dispersion/srcPortPool.txt.
The file will have its original line endings in your working directory
提交到本地仓库
PS D:\1_dev\UDPSender\test1> git commit -m "xxx"
[test_branch 58de0e2] xxx
4 files changed, 400 insertions(+)
create mode 100644 dispersion/dstIpPool.txt
create mode 100644 dispersion/dstPortPool.txt
create mode 100644 dispersion/srcIpPool.txt
create mode 100644 dispersion/srcPortPool.txt
推送
PS D:\1_dev\UDPSender\test1> git push --set-upstream origin test_branch
标签:test1,will,git,gitee,dispersion,添加,本地,txt
From: https://blog.51cto.com/u_15621957/8926147