@@ -42,30 +42,115 @@ Before pushing the site to production, and a great way to demonstrate proposed
4242changes during code review, you should push the changes to your personal GitHub
4343fork as follows:
4444
45- 1 . fork the main repo https://github.com/JanusGraph/janusgraph.org to your
46- account
45+ 1 . [ Fork the website repo] ( https://github.com/JanusGraph/janusgraph.org#fork-destination-box )
46+ to your account via GitHub
4747 * note: the ` master ` branch of this repo is the one that is auto-published to
4848 http://janusgraph.org soon after a commit
49- 1 . clone your copy of the repo locally
50- 1 . checkout the ` gh-pages ` branch or create it if it doesn't exist
51- 1 . make changes on that branch and push ` gh-pages ` to your fork on GitHub
52- 1 . visit the "Settings" page for your fork on GitHub and make the ` gh-pages `
49+
50+ 1 . Clone your copy of the repo locally
51+
52+ ```
53+ $ git clone git@github.com:[USERNAME]/janusgraph.org.git
54+ $ cd janusgraph.org
55+ $ git remote add upstream git@github.com:JanusGraph/janusgraph.org.git
56+ ```
57+
58+ 1 . Create a new branch for your changes, based on the latest changes in the
59+ ` master ` branch of the upstream repo:
60+
61+ ```
62+ $ git checkout master
63+ $ git pull upstream master --ff-only
64+ $ git checkout -b [MY-BRANCH-NAME]
65+ ```
66+
67+ > Note: the ` --ff-only ` flag enforces a "fast-forward" only merge, which
68+ > guarantees that your ` master ` branch is a clean copy of the upstream
69+ > ` master ` branch. If your ` master ` branch cannot be fast-forwarded to match
70+ > the upstream ` master ` , this command will fail. It is recommended to never
71+ > submit your ` master ` branch as a base of a pull request and only keep it to
72+ > sync with upstream.
73+ >
74+ > This process ensures that your pull requests are always minimal and simple
75+ > to review. This approach is also recommended when contributing to other git
76+ > repos as well.
77+
78+ Always create a new branch for each new pull request; never push from your
79+ own ` master ` branch to a new PR, keep a clean ` master ` branch so that it
80+ stays in sync with upstream.
81+
82+ Note: ` [MY-BRANCH-NAME] ` here is a placeholder for a brand-new branch name
83+ that does not yet exist in your repo; the command above will create this new
84+ branch for you.
85+
86+ 1 . Make the changes you need and commit them to this branch.
87+
88+ 1 . Push your feature branch to the ` gh-pages ` branch on your fork on GitHub, so
89+ that everyone will be able to see a preview of your change:
90+
91+ ```
92+ $ git push -f origin [MY-BRANCH-NAME]:gh-pages
93+ ```
94+
95+ Note: ` [MY-BRANCH-NAME] ` is the placeholder for the same branch name as
96+ selected above; this branch must exist at the time of running the above
97+ command.
98+
99+ 1 . Visit the "Settings" page for your fork on GitHub and make the ` gh-pages `
53100 auto-publishable
54101 * note: after you make this change, you will get an email that you could not
55102 publish this site because the CNAME of janusgraph.org is already taken by
56103 another site (i.e., the canonical repo). You will also see a warning about
57104 this on the GitHub UI. Both of these warnings are safe to ignore because we
58105 are trying to create a personal test copy, not update the live site.
59- 1 . now you can visit your site at
106+
107+ 1 . Now you can visit your site at
60108 ` http://[your-username].github.io/janusgraph.org/ ` to see your changes
61- 1 . any changes you continue to push to your ` gh-pages ` branch will keep updating
62- live on GitHub
63-
64- Note: you can also use ` master ` on your fork the same way, since GitHub allows
65- you to auto-publish either ` master ` or ` gh-pages ` , but in the interest of always
66- having a clean ` master ` branch that you can create PRs from, that also tracks
67- the ` master ` from upstream (i.e., https://github.com/JanusGraph/janusgraph.org ),
68- it is highly recommended to use ` gh-pages ` for this purpose instead.
109+
110+ 1 . Now you can push your ` [MY-BRANCH-NAME] ` to your fork to open a pull request
111+ using it.
112+
113+ ** Important:** do not use either ` gh-pages ` or ` master ` branch to submit pull
114+ requests; use a separate feature branch for every change and every pull
115+ request, and delete each of those branches after the pull request is either
116+ merged or abandoned.
117+
118+ 1 . Any changes you continue to push to your ` gh-pages ` branch will keep updating
119+ live on GitHub after a few minutes
120+
121+ Note: you will get warning emails from GitHub saying that your repo is
122+ attempting to publish to the URL ` janusgraph.org ` which is already taken.
123+ This is fine; you can ignore these emails — it is saying that you cannot
124+ publish directly to that hostname from your private repo, which is correct.
125+
126+ ## Update your feature branch to include upstream changes
127+
128+ 1 . First, update your ` master ` branch and pick up the latest changes, run:
129+
130+ ```
131+ $ git checkout master
132+ $ git pull upstream master --ff-only
133+ ```
134+
135+ > Note: the ` --ff-only ` flag enforces a "fast-forward" only merge, which
136+ > guarantees that your ` master ` branch is a clean copy of the upstream
137+ > ` master ` branch. If your ` master ` branch cannot be fast-forwarded to match
138+ > the upstream ` master ` , this command will fail. It is recommended to never
139+ > submit your ` master ` branch as a base of a pull request and only keep it to
140+ > sync with upstream.
141+ >
142+ > This process ensures that your pull requests are always minimal and simple
143+ > to review. This approach is also recommended when contributing to other git
144+ > repos as well.
145+
146+ 1 . Then, update your feature branch via ` git rebase ` to avoid including other
147+ users' changes into your branch, which makes CLA verification harder:
148+
149+ ```
150+ $ git checkout [MY-FEATURE-BRANCH]
151+ $ git rebase master
152+ $ git push -f origin
153+ ```
69154
70155## License
71156
0 commit comments