-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit.txt
More file actions
30 lines (24 loc) · 1.22 KB
/
git.txt
File metadata and controls
30 lines (24 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1. 配置提交人姓名: git config --global user.name “提交人姓名” # (对当前系统用户有效)
2. 配置提交人姓名: git config --global user.email “提交人邮箱” # (对当前系统用户有效)
作用: 识别开发人员, 与登良github的账户无关
3. 查看git配置信息: git config --list
按如下命令来生成 sshkey:
ssh-keygen -t rsa -C "your_email@example.com" (后面的步骤都可以直接回车)
将新生成的key添加到ssh-agent中:
eval "$(ssh-agent -s)"
Agent pid 59566
ssh-add ~/.ssh/id_rsa
查看 ~/.ssh/id_rsa.pub 文件内容,获取到你的 public key
cat ~/.ssh/id_rsa.pub
git remote add C++_Primer_Plus_Gitee git@gitee.com:Twillpower/cpp-primer--plus.git
git remote add C++_Primer_Plus_GitHub git@github.com:Twillpower/Cpp_Primer_Plus.git
git status //查看暂存状态
git add * //暂存所有文件
git commit -m * //推送所有文件至本地库
git remote -v //查看推送链接
git push -u C++_Primer_Plus_GitHub master //推送至GitHub
git push -u C++_Primer_Plus_Gitee master //推送至Gitee (-f:强制提交)
git add *
git commit -m *
git push -u C++_Primer_Plus_GitHub master
git push -u C++_Primer_Plus_Gitee master