python全栈,  系统运维

将本地项目托管到码云中

  • 1.Git 全局设置

在码云中创建好一个仓库后

git config --global user.name "ading2016"
git config --global user.email "934588176@qq.com"
  • 如果本地没有仓库
mkdir monitor
cd monitor
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://gitee.com/hxl123456/monitor.git
git push -u origin master
  • 如果本地已经有了仓库
cd existing_git_repo
git remote add origin https://gitee.com/hxl123456/monitor.git
git push -u origin master

我本地已经有代码目录了

查看git 状态

git status

file

# cd 到代码目录
git add .
git commit -m 'all file'

把代码推到码云远程仓库

git remote add origin https://gitee.com/hxl123456/monitor.git
git push -u origin master

第一次需要输入账号密码

file

分支创建

命令行下面创建新的git 分支

git checkout -b login  #  这里的login 就是分支的名称

查看当前的分支

git branch

file

留言

您的电子邮箱地址不会被公开。 必填项已用*标注

闽ICP备20008591号-1