赞
踩
已有阿里云效的代码库,想迁移gitee却迁移不了,只能把代码先拉取下来,然后重新建库,配置过后,采用同步推送的方式,同步两个库的代码。
- Administrator@USER-20220820DL MINGW64 /e/mango-upc/upc-single/mango-upc-parent
- $ git init
- Initialized empty Git repository in E:/mango-upc/upc-single/mango-upc-parent/.gi
- t/
filemode = false ==> filemode = true
- Administrator@USER-20220820DL MINGW64 /e/mango-upc/upc-single/mango-upc-parent (master)
- $ git remote add gitee git@gitee.com:chenxin04187/mango-upc-parent.git
-
- Administrator@USER-20220820DL MINGW64 /e/mango-upc/upc-single/mango-upc-parent (master)
- $ git remote add codeup git@codeup.aliyun.com:62805d210065edd3d51a8664/mango-upc/upc-single/mango-upc-parent.git
- Administrator@USER-20220820DL MINGW64 /e/mango-upc/upc-single/mango-upc-parent (master)
- $ git remote -v
- codeup git@codeup.aliyun.com:62805d210065edd3d51a8664/mango-upc/upc-single/mang
- o-upc-parent.git (fetch)
- codeup git@codeup.aliyun.com:62805d210065edd3d51a8664/mango-upc/upc-single/mang
- o-upc-parent.git (push)
- gitee git@gitee.com:chenxin04187/mango-upc-parent.git (fetch)
- gitee git@gitee.com:chenxin04187/mango-upc-parent.git (push)
这样就说明已经添加成功了。
- Administrator@USER-20220820DL MINGW64 /e/mango-upc/upc-single/mango-upc-parent (master)
- $ ssh-keygen -t ed25519 -C "xxx@hotmail.com"
- Generating public/private ed25519 key pair.
- Enter file in which to save the key (/c/Users/Administrator/.ssh/id_ed25519):
- Enter passphrase (empty for no passphrase):
- Enter same passphrase again:
- Your identification has been saved in /c/Users/Administrator/.ssh/id_ed25519
- Your public key has been saved in /c/Users/Administrator/.ssh/id_ed25519.pub
- The key fingerprint is:
- SHA256:6N5mUtL0SIJYhcUEbbfTNP1JmYVgKZb/7q0ANkloSYw kty.chan@hotmail.com
- The key's randomart image is:
- +--[ED25519 256]--+
- | .O+o. ooo =.|
- | o E.oo*.o = |
- | o o .+=.+ o . |
- | . . .o=.... o |
- | .=S+= . |
- | .. +..o . |
- | .o .. |
- | ...o ... |
- | .+. .o..|
- +----[SHA256]-----+
C:\Users\Administrator\.ssh目录下找到.pub结尾的文件,打开后复制里面的内容,配置为gitee和阿里云效的公钥
- Administrator@USER-20220820DL MINGW64 /e/mango-upc/upc-single/mango-upc-parent (master)
- $ ssh -T git@gitee.com
- The authenticity of host 'gitee.com (180.76.198.77)' can't be established.
- ED25519 key fingerprint is SHA256:+ULzij2u99B9eWYFTw1Q4ErYG/aepHLbu96PAUCoV88.
- This key is not known by any other names.
- Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
- Warning: Permanently added 'gitee.com' (ED25519) to the list of known hosts.
- Hi xxxx(@xxxx)! You've successfully authenticated, but GITEE.COM does not provide shell access.
-
- Administrator@USER-20220820DL MINGW64 /e/mango-upc/upc-single/mango-upc-parent (master)
- $ ssh -T git@codeup.aliyun.com
- The authenticity of host 'codeup.aliyun.com (118.31.165.50)' can't be established.
- RSA key fingerprint is SHA256:yEGmgQNVrc3QAvDvoBrTCF2s07KwmmQ+AbWi9vSt/fE.
- This key is not known by any other names.
- Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
- Warning: Permanently added 'codeup.aliyun.com' (RSA) to the list of known hosts.
- Welcome to Codeup, xxxx@qq.com!
验证完成后在C:\Users\Administrator\.ssh目录下会多一个known_hosts的文件,里面存放着已知的host
本次操作为同步推送已有仓库,所以是这样弄的:
Administrator@USER-20220820DL MINGW64 /e/mango-upc/upc-single/mango-upc-parent (master) $ git add ./ Administrator@USER-20220820DL MINGW64 /e/mango-upc/upc-single/mango-upc-parent (master) $ git commit -m "迁移工程" [master (root-commit) a9340c9] 迁移工程 3 files changed, 262 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 pom.xml Administrator@USER-20220820DL MINGW64 /e/mango-upc/upc-single/mango-upc-parent (master) $ git push --all gitee Enumerating objects: 5, done. Counting objects: 100% (5/5), done. Delta compression using up to 16 threads Compressing objects: 100% (5/5), done. Writing objects: 100% (5/5), 2.79 KiB | 2.79 MiB/s, done. Total 5 (delta 0), reused 0 (delta 0), pack-reused 0 remote: Powered by GITEE.COM [GNK-6.4] To gitee.com:chenxin04187/mango-upc-parent.git * [new branch] master -> master Administrator@USER-20220820DL MINGW64 /e/mango-upc/upc-single/mango-upc-parent (master) $ git push --all codeup Enumerating objects: 5, done. Counting objects: 100% (5/5), done. Delta compression using up to 16 threads Compressing objects: 100% (5/5), done. Writing objects: 100% (5/5), 2.79 KiB | 2.79 MiB/s, done. Total 5 (delta 0), reused 0 (delta 0), pack-reused 0 To codeup.aliyun.com:62805d210065edd3d51a8664/mango-upc/upc-single/mango-upc-par ent.git * [new branch] master -> master
- $ git push --all codeup
- $ git push --all gitee
- $ git push --tags codeup
- $ git push --tags gitee
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。