-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgit
More file actions
39 lines (33 loc) · 1.14 KB
/
git
File metadata and controls
39 lines (33 loc) · 1.14 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
31
32
33
34
35
36
37
38
39
1.https方式:
a.设置用户名密码
vim ~/.git-credentials
https://{username}:{password}@github.com
git config --global credential.helper store
git push -u origin master
b.git remote add origin https://github.com/promisechen/dpdk.git
git push -u origin master
2.ssh方式:
每次链接需要 执行下面几句
eval "$(ssh-agent -s)"
ssh-add github.key
git push -u origin master
git remote add origin git@github.com:promisechen/linuxbase.git
git push -u origin master
提交文件方法:每次都要 git add xxx git commit -m 'xxx' git push origin master
3.git add <filename>
git add *
这是 git 基本工作流程的第一步;使用如下命令以实际提交改动:
git commit -m "代码提交信息"
现在,你的改动已经提交到了 HEAD,但是还没到你的远端仓库。推送改动
你的改动现在已经在本地仓库的 HEAD 中了。执行如下命令以将这些改动提交到远端仓库:
git push origin master
4.添加文件夹
先添加一个文件
git add --all code2/test
git commit -m 's'
git push -u origin master
在添加一个文件夹
git add --all code2/*
git commit -m 's'
git push -u origin master
5.