把gitlab仓库里的node-day01项目传到本地服务器,再把本地服务器里的node-day01项目传到Gitee代码仓库
1 登录Gitlab,复制代码仓库地址
2 拷贝一刚复制的Git 仓库到本地
root@ubuntu:~# git clone http://192.168.10.9/node-demo/node-day01.git
Cloning into ‘node-day01’…
3 本地服务器上传代码到gitee仓库
- 登录Gitee
- 新建仓库
- clone克隆仓库到本地服务器
进入linux
如果没有安装git,可以执行以下命令安装git
yum install git
git config --global user.name "abc344327477"
git config --global user.email "abc190425@*"
git config --global core.editor "vim"
root@ubuntu:~
Cloning into 'node-day01'...
Username for 'https://gitee.com': abc344327477
Password for 'https://abc344327477@gitee.com':
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), 1.76 KiB | 1.76 MiB/s, done.
root@ubuntu:~
213 aws-iam-authenticator gitlab-damo node-day02 wg0.conf
asd bin go node.yaml
awk-insgres dist.zip kkk prometheus-dev
aws doc.ttx kuboard-v3.yaml snap
- 进入node-day01,并拷贝node-day01里的所有文件到node-day02中
cd /root/node-day01
cp -r /root/node-day01/* /root/node-day02
root@ubuntu:~/node-day02
total 1316
drwxr-xr-x 8 root root 4096 Mar 15 16:18 ./
drwx------ 21 root root 4096 Mar 15 15:27 ../
-rw-r--r-- 1 root root 89 Mar 15 16:18 babel.config.js
drwxr-xr-x 3 root root 4096 Mar 15 16:18 blog/
-rw-r--r-- 1 root root 92 Mar 15 16:18 Dockerfile
-rw-r--r-- 1 root root 212 Mar 15 16:18 Dockerfile-123
drwxr-xr-x 4 root root 4096 Mar 15 16:18 docs/
-rw-r--r-- 1 root root 3252 Mar 15 16:18 docusaurus.config.js
drwxr-xr-x 8 root root 4096 Mar 15 15:56 .git/
-rw-r--r-- 1 root root 333 Mar 15 16:18 my.conf
drwxr-xr-x 7 root root 4096 Mar 15 16:17 node-day01/
-rw-r--r-- 1 root root 614 Mar 15 16:18 node.yaml
-rw-r--r-- 1 root root 924 Mar 15 16:18 package.json
-rw-r--r-- 1 root root 911675 Mar 15 16:18 package-lock.json
-rw-r--r-- 1 root root 821 Mar 15 15:21 README.en.md
-rw-r--r-- 1 root root 770 Mar 15 16:18 README.md
-rw-r--r-- 1 root root 727 Mar 15 16:18 sidebars.js
drwxr-xr-x 5 root root 4096 Mar 15 16:18 src/
drwxr-xr-x 3 root root 4096 Mar 15 16:18 static/
-rw-r--r-- 1 root root 359001 Mar 15 16:18 yarn.lock
其中README.md是文档说明,采用Markdown格式编写。
root@ubuntu:~/node-day02
root@ubuntu:~/node-day02
On branch master
Your branch is up to date with 'origin/master'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: blog/2019-05-28-first-blog-post.md
new file: blog/2019-05-29-long-blog-post.md
new file: blog/2021-08-01-mdx-blog-post.mdx
new file: blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg
new file: blog/2021-08-26-welcome/index.md
new file: blog/authors.yml
new file: docs/Ga-staking/_category_.json
new file: docs/Ga-staking/read.md
new file: docs/Phoneix-pubk/_category_.json
new file: docs/Phoneix-pubk/read.md
new file: docs/intro.md
new file: src/components/HomepageFeatures/index.js
new file: src/components/HomepageFeatures/styles.module.css
new file: src/css/custom.css
new file: src/pages/index.js
new file: src/pages/index.module.css
new file: src/pages/markdown-page.md
new file: static/.nojekyll
new file: static/img/docusaurus.png
new file: static/img/favicon.ico
new file: static/img/logo.svg
new file: static/img/tutorial/docsVersionDropdown.png
new file: static/img/tutorial/localeDropdown.png
new file: static/img/undraw_docusaurus_mountain.svg
new file: static/img/undraw_docusaurus_react.svg
new file: static/img/undraw_docusaurus_tree.svg
root@ubuntu:~/node-day02
[master 162c72e] d
26 files changed, 1491 insertions(+)
create mode 100644 blog/2019-05-28-first-blog-post.md
create mode 100644 blog/2019-05-29-long-blog-post.md
create mode 100644 blog/2021-08-01-mdx-blog-post.mdx
create mode 100644 blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg
create mode 100644 blog/2021-08-26-welcome/index.md
create mode 100644 blog/authors.yml
create mode 100644 docs/Ga-staking/_category_.json
create mode 100644 docs/Ga-staking/read.md
create mode 100644 docs/Phoneix-pubk/_category_.json
create mode 100644 docs/Phoneix-pubk/read.md
create mode 100644 docs/intro.md
create mode 100644 src/components/HomepageFeatures/index.js
create mode 100644 src/components/HomepageFeatures/styles.module.css
create mode 100644 src/css/custom.css
create mode 100644 src/pages/index.js
create mode 100644 src/pages/index.module.css
create mode 100644 src/pages/markdown-page.md
create mode 100644 static/.nojekyll
create mode 100644 static/img/docusaurus.png
create mode 100644 static/img/favicon.ico
create mode 100644 static/img/logo.svg
create mode 100644 static/img/tutorial/docsVersionDropdown.png
create mode 100644 static/img/tutorial/localeDropdown.png
create mode 100644 static/img/undraw_docusaurus_mountain.svg
create mode 100644 static/img/undraw_docusaurus_react.svg
create mode 100644 static/img/undraw_docusaurus_tree.svg
root@ubuntu:~/node-day02
Username for 'https://gitee.com': abc344327477
Password for 'https://abc344327477@gitee.com':
Enumerating objects: 42, done.
Counting objects: 100% (42/42), done.
Delta compression using up to 8 threads
Compressing objects: 100% (36/36), done.
Writing objects: 100% (41/41), 190.75 KiB | 15.90 MiB/s, done.
Total 41 (delta 1), reused 0 (delta 0)
remote: Powered by GITEE.COM [GNK-6.3]
To https://gitee.com/abc344327477/node-day02.git
162c72e..d7ba02a master -> master
- 回到giett ,node-day02库中查看上传成功的代码
这样我们就成功的将本地代码上传到gitee代码仓库了。
git clone 项目地址 拉项目
git pull 拉代码
git push 提交到仓库
git init 指令初始化一个git仓库
git add .添加文件
git commit -m "注释"提交至仓库。
git remote add origin https://git.oschina.net/你的用户名/项目名.
git,git push origin master即可完成推送
git checkout master 切换到master分支
报错:
提交代码遇到『Everything up-to-date』
出现这个问题的原因是git提交改动到缓存,要push的时候不会将本地所有的分支都push掉,所以出现这个问题。我们应该告诉git提交哪个分支。
1 使用git branch查看有什么分支
root@ubuntu:~/node-day02
a
*master
2 输入 git checkout master切换到master上
root@ubuntu:~/node-day02
Already on 'master'
Your branch is up to date with 'origin/master'.
3 这样就切换完了,可以 $ git branch 确认下。然后你要将你的改动提交到新的分支上,前面的*代表的是当前你所在的工作分支
root@ubuntu:~/node-day02
a
*master
root@ubuntu:~/node-day02
4 提交
git add .
git commit -m 'cccccc'
5 此时可以 git status 检查下提交情况。如果提交成功,我们接下来就要回主分支了,代码和之前一样。
git checkout master
6 执行git push ,就能在gitee看到提交的的代码
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)