代碼託管倉庫之碼雲

碼雲是一個代碼託管倉庫,做爲編程人員,你們應該都聽過過或使用過github吧,若是說github是全世界編程者的代碼倉庫,碼雲是實際上就是中國的github,github因爲服務器在外國,可能在國內咱們訪問速度回很是慢,而碼雲做爲國內最經常使用的倉庫之一,速度和友好型方面天然會號不少。python

首先註冊一個帳號,以後能夠建立一個倉庫git

gitee入門

  Git 全局設置:github

git config --global user.name "張亞飛"
git config --global user.email "1271570224@qq.com"

  建立 git 倉庫:shell

mkdir lstm-crf
cd lstm-crf
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://gitee.com/zhangyafeii/lstm-crf.git
git push -u origin master

  已有倉庫?編程

cd existing_git_repo
git remote add origin https://gitee.com/zhangyafeii/lstm-crf.git
git push -u origin master

 出現錯誤服務器

$ git push -u origin master
To git@gitee.com:zhangyafeii/ordering_system.git
 ! [rejected]  master -> master (fetch first)
error: failed to push some refs to 'git@gitee.com:zhangyafeii/ordering_system.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details. 

 解決ssh

$ git pull origin master --allow-unrelated-histories
此時會有一個彈窗,提示你修改一個文檔的內容,不用管他,按ESC鍵
再按SHIFT+;  (SHIFT+;用來輸入一個冒號)  再輸入wq!保存

$ git push -u origin master

# 成功!

添加ssh公鑰

 

 本地操做ide

# 1. 生成一對ssh祕鑰ssh-keygen -t rsa -C '1271570224@qq.com@gitee.com
提示輸出保存文件路徑及文件名(默認/c/Users/fei/.ssh/id_rsa):gitee_user(可根據須要修改)輸入兩次git密碼# 2. 查看公鑰
cat gitee_user.pub
# 3. 測試SSH,運行ssh -T git@gitee.c
Hi 張亞飛! You've successfully authenticated, but GITEE.COM does not provide shell access.
相關文章
相關標籤/搜索