git 本地与远程仓库连接 上传文件


001@DESKTOP-18RGJTE MINGW64 /d/code/p5/JS/day16
$ git init
Initialized empty Git repository in D:/code/p5/JS/day16/.git/

001@DESKTOP-18RGJTE MINGW64 /d/code/p5/JS/day16 (master)
$ git remote add origin git@gitee.com:meng13666/laoshidaima.git

001@DESKTOP-18RGJTE MINGW64 /d/code/p5/JS/day16 (master)
$ git status
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        66.txt
        hr_p2112/

nothing added to commit but untracked files present (use "git add" to track)

001@DESKTOP-18RGJTE MINGW64 /d/code/p5/JS/day16 (master)
$ git add .
warning: adding embedded git repository: hr_p2112
hint: You've added another git repository inside your current repository.
hint: Clones of the outer repository will not contain the contents of
hint: the embedded repository and will not know how to obtain it.
hint: If you meant to add a submodule, use:
hint:
hint:   git submodule add <url> hr_p2112
hint:
hint: If you added this path by mistake, you can remove it from the
hint: index with:
hint:
hint:   git rm --cached hr_p2112
hint:
hint: See "git help submodule" for more information.

001@DESKTOP-18RGJTE MINGW64 /d/code/p5/JS/day16 (master)
$ git status
On branch master

No commits yet

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)
        new file:   66.txt
        new file:   hr_p2112


001@DESKTOP-18RGJTE MINGW64 /d/code/p5/JS/day16 (master)
$ git commit -m "第一次权限"
[master (root-commit) 1815e44] 绗竴娆℃潈闄? 2 files changed, 2 insertions(+)
 create mode 100644 66.txt
 create mode 160000 hr_p2112

001@DESKTOP-18RGJTE MINGW64 /d/code/p5/JS/day16 (master)
$ git remote -v
origin  git@gitee.com:meng13666/laoshidaima.git (fetch)
origin  git@gitee.com:meng13666/laoshidaima.git (push)

001@DESKTOP-18RGJTE MINGW64 /d/code/p5/JS/day16 (master)
$ git push origin master
To gitee.com:meng13666/laoshidaima.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'gitee.com:meng13666/laoshidaima.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

001@DESKTOP-18RGJTE MINGW64 /d/code/p5/JS/day16 (master)
$ git pull origin master --allow-unrelated-histories
From gitee.com:meng13666/laoshidaima
 * branch            master     -> FETCH_HEAD
Merge made by the 'recursive' strategy.
 README.en.md | 36 ++++++++++++++++++++++++++++++++++++
 README.md    | 39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 75 insertions(+)
 create mode 100644 README.en.md
 create mode 100644 README.md

001@DESKTOP-18RGJTE MINGW64 /d/code/p5/JS/day16 (master)
$ git push origin master
Enumerating objects: 6, done.
Counting objects: 100% (6/6), done.
Delta compression using up to 8 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 615 bytes | 307.00 KiB/s, done.
Total 5 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Powered by GITEE.COM [GNK-6.3]
To gitee.com:meng13666/laoshidaima.git
   5264e2f..45a91a8  master -> master

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值