-
Notifications
You must be signed in to change notification settings - Fork 706
SSG on GitHub Primer
Looking for a quick(ish) start guide?
This document was blatantly plagerized from official GitHub help pages, blogs, and notes from SSG community members. Sources include:
- https://help.github.com/articles/fork-a-repo
- https://help.github.com/articles/syncing-a-fork
- https://help.github.com/articles/pushing-to-a-remote
When you fork SSG in order to propose changes, you can configure your fork to rebase changes from the upstream SSG repository. The following steps demonstrate how to do that.
(1) Fork SSG on GitHub. Clone your fork of SSG locally, e.g.:
$ https://github.com/_**{your_username}**_/scap-security-guide.git
(2) Type git remote -v
and press Enter. You’ll see the current configured remote repository for your fork:
$ git remote -v
origin [email protected]:_**{your_username}**_/scap-security-guide.git (fetch)
origin [email protected]:_**{your_username}**_/scap-security-guide.git (push)
To add SSG as your upstream repository:
$ git remote add upstream https://github.com/OpenSCAP/scap-security-guide.git
(3) To verify the new upstream repository, type git remote -v
again. You should see the URL for your fork as origin, and the URL for the SSG repository as upstream.
$ git remote -v
origin [email protected]:{your_username}/scap-security-guide.git (fetch)
origin [email protected]:{your_username}/scap-security-guide.git (push)
upstream https://github.com/OpenSCAP/scap-security-guide.git (fetch)
upstream https://github.com/OpenSCAP/scap-security-guide.git (push)
Occasionally it will be needed to rebase your local repository to keep it up-to-date with the upstream SSG content. To do so:
(1) Fetch the branches and their respective commits from the upstream repository. Commits to master will be stored in a local branch, upstream/master.
$ git fetch upstream
(2) Check out your fork’s local master branch:
$ git checkout master
(3) Merge the changes from upstream/master into your local master branch. This brings your fork’s master branch into sync with the upstream repository, without losing your local changes.
$ git merge upstream/master
NOTE: If your local branch didn’t have any unique commits, Git will instead perform a “fast-forward”:
$ get merge upstream/master
Updating 34e91da..16c56ad
Fast-forward
README.md | 5 +++—
1 file changed, 3 insertions(+), 2 deletions(-)