This repository was archived by the owner on Jul 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgit-usage.txt
More file actions
139 lines (111 loc) · 4.47 KB
/
git-usage.txt
File metadata and controls
139 lines (111 loc) · 4.47 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
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
---------------------------- Jean's notes ----------------------------
The Git repository is at https://github.com/.
Please create an account, send it to me and I'll try to add you to the
existing repository.
In Git, breanches are cheap. We will work by implementing each feature
or bugfix in its own separate branch, and merge those branches as
needed. The name of the branch should include your own name, so that
if two people work on a feature, each can have its own version.
--- init repo ---
git clone git@github.com:OpenNetworkingFoundation/extensibility
cd extensibility
git fetch
git config --global user.name "Jean Tourrilhes"
git config --global user.email "jean.tourrilhes@hp.com"
--- get latest ---
git fetch
git branch
git branch -a
--- create a new branch ---
# creates local branch called 'master' from remote branch
git checkout -t remotes/origin/master
# creates local branch called 'spec/jean/set_queue` from remote
git checkout -b spec/jean/set_queue remotes/origin/master
--- export to GitHub ---
git status
git commit -a
git push origin spec/jean/set_queue
--- Rename branch, Delete remote branch ---
git branch -m jean/ticket287 spec/jean/ticket287
git branch -D jean/set_queue
git push origin :jean/ticket287
--- Other ---
git cherry-pick XXXX
git fsck --full --no-reflogs | grep commit
git show XXX
--- rebase ---
git fetch
git remote prune origin
git checkout spec1.1
git pull --rebase origin spec1.1
git checkout jean/set_queue
git rebase spec1.1
<resolve merges>
git add include/openflow/openflow.h
git rebase --continue
--- Flat merge ---
git checkout -b ticket283 origin/spec/jean/ticket283
git rebase spec/jean/spec1.1.1
<ticket283 stuff with be atop spec1.1.1 in the ticket283 branch>
git checkout spec/jean/spec1.1.1
git merge ticket283
<Git will say "did fast-forward", and no merge commit will be generated.>
git push origin spec/jean/spec1.1.1
git branch -D ticket283 origin/spec/brandonh/ticket283
-------------------------- Brandon's notes --------------------------
More notes on ssh keygen here: http://help.github.com/linux-key-setup/.
I haven't run through these instructions myself but they should work.
Checkout the repo:
git clone git@github.com:OpenNetworkingFoundation/extensibility
cd extensibility
# grab all branches
git fetch
# checkout a local tracking copy of the remote starting branch:
# -b means create a new branch
git checkout -b master remotes/origin/master
# make a private branch for your changes
# prepend your name and the feature you're adding.
# example (just kidding w/json):
git checkout -b brandonh/json_ofp_match
# Before committing, you'll need to set your git username and email.
# Do this now.
git config --global user.name "Fill Me In"
git config --global user.email "user@domain.com"
The spec is in the of-spec/ folder.
To build, I use MacTex, which includes a nice Mac-specific editor (TeXShop),
from which you can click a .tex file and then click 'typeset' to create, no
Makefile needed. There's a makefile in this dir which you can use with
Linux. See README for more info.
Before building, you'll have to generate the LaTeX output for formatting
enums, defines, and tables from openflow.h. To generate these, run:
./make_latex_input.pl
Run this after every openflow.h change.
# After making your changes, commit them.
# Check the status of what files have changed (should only be
openflow-spec.tex and appendix.tex):
git status
# Add what you want.
# Example for appendix.tex
git add appendix.tex
# Commit. Please keep them atomic: ex. the multipath branch should have
# separate commits for going to 32 bits of port space and defining group mods.
# Standard format is 'spec:' followed by a short (<50-char) description of
# the change.
# For more description, skip a line and Follow it with more details on
# 80-char lines.
# For more complex commits run git commit without -m and a text editor
# should pop up.
# Please have major commits reference the wiki in the long description.
# These commits will archived forever in the OpenFlow history so make them
# good.
git commit -m "spec: Define new tags
Derived from the tags proposal on the OpenFlow wiki:
http://openflowswitch.org/wk/index.php/Tags_Proposal
"
# Push. An email will automatically go out to everyone in openflow-core
# with the changes.
git push origin brandonh/json_ofp_match
Let me know if you have any issues. The benefit of all this is that changes
will be easy for me to review, edit, and merge. There's lots of good git
starting info out there now if you get stuck, and you can IM me too.
-b