IDEA上传华为云
-
1 创建本地仓库
git init
-
2 设置提交代码时的用户信息
git config --global user.name "[name]"
git config --global user.email "[email address]"
例如:git config --global user.name “xxx@163.com”
git config --global user.email “xxx@163.com” -
3 提交到本地库
方式1:
git status
----显示有变更的文件
git add .
----添加当前目录的所有文件到暂存区
git add [dir]
----添加指定目录到暂存区,包括子目录
例如:git add pom.xml
git commit -m [message]
----提交暂存区到仓库区
例如:git commit -m “初始化项目”
方式2:
-
4 增加一个新的远程仓库,并命名
git remote add huawei [url]
url为远程仓库的地址 -
5 设置公钥
ssh-keygen -t rsa -C [name]
例如:ssh-keygen -t rsa -C “xxx@163.com” -
6 将目录下的公钥写入到剪切板
clip < ~/.ssh/id_rsa.pub
-
7 在远程库设置公钥
-
8 将代码提交到远程库
git push huawei master