gitee和本地的ssh密钥连接。
ssh-keygen -t rsa -C "[email protected]"
ćŒ‰ç
§ćç¤şĺŽŒćˆä¸‰ćŹĄĺ›žč˝ŚďźŒĺłĺŻç”Ÿćˆ ssh key。
cat ~/.ssh/id_rsa.pub
C:\Users\37310>ssh -T [email protected]
The authenticity of host 'gitee.com (212.64.62.174)' can't be established.
ECDSA key fingerprint is SHA256:FQGC9Kn/eye1W8icdBgrQp+KkGYoFgbVr17bmjey0Wc.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'gitee.com,212.64.62.174' (ECDSA) to the list of known hosts.
Hi [36;01mćľŞĺˆ°çˆŞĺ“‡ĺ˛›ĺ–ĺ’–ĺ•Ą[0m! You've [32msuccessfully[0m authenticated, but GITEE.COM does not provide shell access.
git如何上传和下载详细操作步骤!https://www.cnblogs.com/ximiaomiao/p/7140456.html
``shell
37310@LAPTOP-3S393SR0 MINGW64 /d/projects/éĄšç›ŽĺŽžćˆ˜day01/code/vue_shop
$ git remote add origin https://gitee.com/buzen/vue_shop.git
fatal: not a git repository (or any of the parent directories): .git
37310@LAPTOP-3S393SR0 MINGW64 /d/projects/éĄšç›ŽĺŽžćˆ˜day01/code/vue_shop
$ git init
Initialized empty Git repository in D:/projects/éĄšç›ŽĺŽžćˆ˜day01/code/vue_shop/.git/
37310@LAPTOP-3S393SR0 MINGW64 /d/projects/éĄšç›ŽĺŽžćˆ˜day01/code/vue_shop (master)
$ git remote add origin https://gitee.com/buzen/vue_shop.git
37310@LAPTOP-3S393SR0 MINGW64 /d/projects/éĄšç›ŽĺŽžćˆ˜day01/code/vue_shop (master)
$ git status
On branch master
No commits yet
Untracked files:
(use “git add …” to include in what will be committed)
.browserslistrc
.editorconfig
.eslintrc.js
.gitignore
README.md
babel.config.js
package-lock.json
package.json
public/
src/
nothing added to commit but untracked files present (use “git add” to track)
37310@LAPTOP-3S393SR0 MINGW64 /d/projects/éĄšç›ŽĺŽžćˆ˜day01/code/vue_shop (master)
$ git add.
git: ‘add.’ is not a git command. See ‘git --help’.
The most similar command is
add
37310@LAPTOP-3S393SR0 MINGW64 /d/projects/éĄšç›ŽĺŽžćˆ˜day01/code/vue_shop (master)
$ git add .
warning: LF will be replaced by CRLF in .browserslistrc.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in .editorconfig.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in .eslintrc.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in .gitignore.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in README.md.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in babel.config.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in package-lock.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in package.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in public/index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/App.vue.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/components/HelloWorld.vue.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/plugins/element.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/router/index.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/views/About.vue.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/views/Home.vue.
The file will have its original line endings in your working directory
37310@LAPTOP-3S393SR0 MINGW64 /d/projects/éĄšç›ŽĺŽžćˆ˜day01/code/vue_shop (master)
$ git commit -m ‘add files’
[master (root-commit) 4763859] add files
18 files changed, 12393 insertions(+)
create mode 100644 .browserslistrc
create mode 100644 .editorconfig
create mode 100644 .eslintrc.js
create mode 100644 .gitignore
create mode 100644 README.md
create mode 100644 babel.config.js
create mode 100644 package-lock.json
create mode 100644 package.json
create mode 100644 public/favicon.ico
create mode 100644 public/index.html
create mode 100644 src/App.vue
create mode 100644 src/assets/logo.png
create mode 100644 src/components/HelloWorld.vue
create mode 100644 src/main.js
create mode 100644 src/plugins/element.js
create mode 100644 src/router/index.js
create mode 100644 src/views/About.vue
create mode 100644 src/views/Home.vue
37310@LAPTOP-3S393SR0 MINGW64 /d/projects/éĄšç›ŽĺŽžćˆ˜day01/code/vue_shop (master)
$ git status
On branch master
nothing to commit, workigit
``
很明显,昨天项目只是提交到了本地仓库,并没有提交到远程仓库!!!
git add
git commit -m 说明
git push
git clone 远程仓库地址
37310@LAPTOP-3S393SR0 MINGW64 /d/projects/项目实战day01/code/vue_shop (master)
$ git status
On branch master
nothing to commit, working tree clean
37310@LAPTOP-3S393SR0 MINGW64 /d/projects/项目实战day01/code/vue_shop (master)
$ git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin master
37310@LAPTOP-3S393SR0 MINGW64 /d/projects/项目实战day01/code/vue_shop (master)
$ git push --set-upstream origin master
Enumerating objects: 27, done.
Counting objects: 100% (27/27), done.
Delta compression using up to 12 threads
Compressing objects: 100% (22/22), done.
Writing objects: 100% (27/27), 90.15 KiB | 2.05 MiB/s, done.
Total 27 (delta 0), reused 0 (delta 0)
remote: Powered by GITEE.COM [GNK-5.0]
remote: error: GE007: Your push would publish a private email address.
remote: You can make your email public or disable this protection by visiting:
remote: https://gitee.com/profile/emails
remote: error: hook declined to update refs/heads/master
To https://gitee.com/buzen/vue_shop.git
! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'https://gitee.com/buzen/vue_shop.git'
这边报错remote: error: GE007: Your push would publish a private email address.
解决方法:
在GitHub的你账号网页上右上角,个人的登录退出的位置,找到setting:
setting->emails->Keep my email address private,把这一项去掉勾选即可。
37310@LAPTOP-3S393SR0 MINGW64 /d/projects/项目实战day01/code/vue_shop (master)
$ git push
Everything up-to-date