您当前的位置: 首页 >  git

江湖有缘

暂无认证

  • 0浏览

    0关注

    446博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

上传代码到gitee操作

江湖有缘 发布时间:2022-03-17 18:01:23 ,浏览量:0

上传代码到gitee操作
  • 一、查看本地仓库状态
    • 1.查看本地仓库状态
    • 2.查看本地工作区状态
  • 二、Git 全局设置
  • 三、无本地仓库和本地代码时
  • 四、已有本地git仓库时

一、查看本地仓库状态 1.查看本地仓库状态
[root@k8s-master rege_git]# git log --oneline 
21b8da9 (HEAD -> master, tag: V1.0, origin/master) 7.0-master hebing file xiaowu.txt
971127e 6.0-mster create a xiaowu.txt && xiaowu 6666
8f95061 (origin/xiaowu, xiaowu) 5.0-xiaowu create a xiaowu.txt
6a28554 4.0-lisi crate file lisi.txt
2d7bee4 2.0 create a stash.txt
ebc7eb6 1.0-create the file

2.查看本地工作区状态
[root@k8s-master rege_git]# git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

二、Git 全局设置
root@k8s gitlab]# useradd zhangsan
[root@k8s gitlab]# passwd zhangsan 
Changing password for user zhangsan.
New password: 
BAD PASSWORD: The password fails the dictionary check - it is too simplistic/systematic
Retype new password: 
passwd: all authentication tokens updated successfully.
[root@k8s gitlab]# su - zhangsan

三、无本地仓库和本地代码时
mkdir test
cd test
git init 
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin git@gitee.com:zhangsan/test.git
git push -u origin "master"
四、已有本地git仓库时
cd existing_git_repo   # 进入本地git仓库
git remote add origin git@gitee.com:zhangsan/test.git    # 连接到远程仓库
git push -u origin "master"  #上传主分支代码
git push -u origin --all   #上传全部代码
关注
打赏
1665849170
查看更多评论
立即登录/注册

微信扫码登录

0.0386s