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