forked from archerslaw/pysam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
github_configure.txt
186 lines (165 loc) · 5.77 KB
/
github_configure.txt
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
- Create a new repository on the command line:
# touch README.md
# git init
# git add README.md
# git commit -m "add README for this project."
# git remote add origin https://github.com/sibiaoluo/pysam.git
# git push -u origin master
- Push an existing repository from the command line:
# mkdir pyxxx
# cd pyxxx
# git init
# touch README.md
# git add README.md
# git commit -m "add README for this project."
# git remote add origin https://github.com/sibiaoluo/pyxxx.git
# git push -u origin master
- Partial git user config:
pysam]# git config user.name "Sibiao Luo"
pysam]# git config user.email [email protected]
pysam]# cat .git/config | tail -3
[user]
name = Sibiao Luo
email = [email protected]
- Global git user config:
# git config --global user.name "Sibiao Luo"
# git config --global user.email [email protected]
# # cat ~/.gitconfig | head -3
[user]
name = Sibiao Luo
email = [email protected]
- The whole system config:
$ sudo git config --system core.editor vim
$ cat /etc/gitconfig
[core]
editor = vim
- Create/delete Branch:
pycmdb]# ls -lh .git/refs/heads/master
-rw-r--r-- 1 root root 41 Jul 11 22:51 .git/refs/heads/master
pycmdb]# git checkout -b mybranch1
Switched to a new branch 'mybranch1'
pycmdb]# touch hello1
pycmdb]# git add hello1
pycmdb]# git commit -m "add hello1 for mark."
[mybranch1 01f3fc3] add hello1 for mark.
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 hello1
pycmdb]# git push origin mybranch1
Username:
Password:
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 268 bytes, done.
Total 2 (delta 1), reused 0 (delta 0)
To https://github.com/sibiaoluo/pycmdb.git
* [new branch] mybranch1 -> mybranch1
pycmdb]# git branch
master
* mybranch1
pycmdb]# git branch -r
origin/master
origin/mybranch1
pycmdb]# git ls-remote
From https://github.com/sibiaoluo/pycmdb.git
102dcd1d166ed27b9b40d834e104b5e0b4a8044f HEAD
102dcd1d166ed27b9b40d834e104b5e0b4a8044f refs/heads/master
01f3fc3e7252769a2d879045af7d0c2b86a15c5d refs/heads/mybranch1
pycmdb]# git branch -d mybranch1
error: Cannot delete the branch 'mybranch1' which you are currently on.
pycmdb]# git checkout master
Switched to branch 'master'
pycmdb]# git branch
* master
mybranch1
pycmdb]# git branch -D mybranch1
Deleted branch mybranch1 (was 01f3fc3).
pycmdb]# git push origin :mybranch1
Username:
Password:
To https://github.com/sibiaoluo/pycmdb.git
- [deleted] mybranch1
pycmdb]# git ls-remote
From https://github.com/sibiaoluo/pycmdb.git
102dcd1d166ed27b9b40d834e104b5e0b4a8044f HEAD
102dcd1d166ed27b9b40d834e104b5e0b4a8044f refs/heads/master
- Tag:
pycmdb]# ls -lh .git/refs/tags/
total 0
1).# git tag <tagname> [<commit>]
2).# git tag -a <tagname> [<commit>]
3).# git tag -s <tagname> [<commit>]
e.g:
pycmdb]# git tag -m "Tag on initial commit." mytag1
pycmdb]# git tag -m "Tag on new commit." mytag2
pycmdb]# git tag mytag3
pycmdb]# git tag -l -n1
mytag1 Tag on initial commit.
mytag2 Tag on new commit.
mytag3 add hello1 for mark.
pycmdb]# ls -lh .git/refs/tags/*
-rw-r--r-- 1 root root 41 Jul 12 00:57 .git/refs/tags/mytag1
-rw-r--r-- 1 root root 41 Jul 12 00:58 .git/refs/tags/mytag2
-rw-r--r-- 1 root root 41 Jul 12 00:58 .git/refs/tags/mytag3
pycmdb]# git push origin refs/tags/*
Username:
Password:
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 459 bytes, done.
Total 4 (delta 2), reused 0 (delta 0)
To https://github.com/sibiaoluo/pycmdb.git
* [new tag] mytag1 -> mytag1
* [new tag] mytag2 -> mytag2
* [new tag] mytag3 -> mytag3
pycmdb]# git tag -d mytag3
Deleted tag 'mytag3' (was 4db002f)
pycmdb]# git push origin :mytag3
Username:
Password:
To https://github.com/sibiaoluo/pycmdb.git
- [deleted] mytag3
pycmdb]# git tag -d mytag1 mytag2
Deleted tag 'mytag1' (was 0d9bdea)
Deleted tag 'mytag2' (was 18913ea)
pycmdb]# git push origin :mytag1 :mytag2
Username:
Password:
To https://github.com/sibiaoluo/pycmdb.git
- [deleted] mytag1
- [deleted] mytag2
-Github SSH Public Keys:
1).User level Management.
pycmdb]# ssh -T [email protected]
The authenticity of host 'github.com (204.232.175.90)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,204.232.175.90' (RSA) to the list of known hosts.
Hi sibiaoluo! You've successfully authenticated, but GitHub does not provide shell access.
2).Project level Management.
'github.com/sibiaoluo/pycmdb/'--->'Deploy Keys'
$ ssh -i ~/.ssh/deploy-key -T [email protected]
Hi sibiaoluo/pycmd! You've successfully authenticated, but GitHub does not provide shell access.
-Collaborative Work with Github:
1).'Fork + Pull' Distributed Operating Mode:
Fork & Pull Request & Online Editing.
No ISSUE of the Origin.
Pull Request--->"Commits"--->"Files Changed"--->"Preview Discussion"(write the subject and context)--->"Send Pull Request"--->'close & comment' OR 'Comment this Pull Request' OR 'This pull request can be automatically merge'--->'Merge pull request'--->'Confirm Merge'
2).Traditional centralized collaborative work mode.
Project Repo-->'Collaborators'
$ git fetch
$ git merge
git pull = git fetch + git merge: $ git pull
($ git reset --hard)
$ git push
$ git fetch origin
$ git rebase origin/master
$ git push
$ git pull --rebase OR $ git config branch.master.rebase true OR $ git config --global branch.autosetuprebase true
-Bug Tracking:
Issues / Pull Request / label
-Milestones:
Sprint / tag / branch
Refference:
http://gitbook.liuhui998.com/