使用ssh建立git仓库连接

1
2
3
ssh-keygen -t rsa -b 4096 -C "github@com"
cat ~/.ssh/id_isa.pub
#内容拷贝到github的ssh设置里

将本地与远程建立连接

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
git remote add origin git@github.com:..... .git
##初始化
git init
##获取远程的分支
git fetch origin
##切换分支
git checkout <branch-name>
##添加内容
git add file
git commit -m "information"
git push orgin <branch-name>
##创立分支
git checkout -b <branch-name>
##上传分支
git push -u origin <branch-name>
##合并分支
##获取最新的分支和改变
git fetch origin
git checkout main
git merge origin/feature-branch
##删除分支
git branch -d <branch-name>
##验证
git branch -r