-
You need a GitHub account
-
Install
git
on your computer. -
Fork
the scalabridge/curriculum repository:- On GitHub, navigate to the scalabridge/curriculum repository.
- In the top-right corner of the page click Fork.
-
Create a local
clone
of your fork to put the repository on your local computer:-
On GitHub, navigate to your fork of the scalabridge/curriculum repository.
-
Under your repository name, to the right, click Clone or download.
-
In the Clone with HTTPs section, click the "Copy to clipboard" icon to copy the clone URL for the repository.
-
On Linux or Mac, open a
terminal
, on Windows openGit Bash
. From the prompt, if needed, change the working directory to be the one in which you want the repository files created. -
Type
git clone
, and then paste the URL you copied in step 3 above. The command line should look like this, with your GitHub username instead of YOUR-USERNAME:$ git clone https://github.com/YOUR-USERNAME/curriculum.git
Press
Enter
and git will create your local clone
-
-
Link the Github (remote) version of the repository with your local version so it will synchronize before you make changes:
-
On GitHub, navigate to the scalabridge/curriculum repository.
-
Under the repository name, to the right, click Clone or download.
-
In the Clone with HTTPs section, click the "Copy to clipboard" icon to copy the clone URL for the repository.
-
On Linux or Mac, open a
terminal
, on Windows openGit Bash
. From the prompt, if needed, change the working directory to the location of your local repository. -
Type
git remote add upstream
, and then paste the URL you copied in step 3 above. The command line should look like this:$ git remote add upstream https://github.com/scalabridge/curriculum.git
Press
Enter
and git will create your local clone
-
-
Verify your remote repositories by entering
git remote -v
. You should see the URL for your fork asorigin
, and the URL for the scalabridge repository asupstream
:$ git remote -v origin https://github.com/YOUR-USERNAME/curriculum.git (fetch) origin https://github.com/YOUR-USERNAME/curriculum.git (push) upstream https://github.com/scalabridge/curriculum.git (fetch) upstream https://github.com/scalabridge/curriculum.git (push)
-
Syncing your fork: Start with your local and forked repository being up-to-date with scalabridge/master:
- Open terminal or Git Bash and change working directory to your local repository
- Fetch the branches and their respective commits from the upstream repository. Commits to
master
will be stored in a local branch,upstream/master
. - Then merge the changes from
upstream/master
into your localmaster
branch. - Finally, update your forked repository on GitHub by pushing the changes to
origin
:
$ git fetch upstream # Fetch the branches and their respective commits # From https://github.com/scalabridge/curriculum # [new branch] master -> upstream/master # merge upstream/master into local master $ git checkout master $ git merge upstream/master # push changes to your forked repository $ git push origin
-
Create a topic branch on your local repository.
- From the repository directory
git checkout master
to make master the basegit checkout -b TOPIC-NAME
, where TOPIC-NAME is an appropriate name for branch, e.g "contributing"
-
Make your changes: hack, hack, edit, hack, edit, ...
-
Add and commit changes to your topic branch. Refer to the Git Documentation for details on
add
andcommit
usage:- Use the
git add
command to add content to the index that defines the snapshot that will be committed, - Use the
git commit
command to commit the index to the current working branch, or - Use
git commit -a
to add and commit all changes.
$ git add * # adds all changes to index $ git add CONTRIBUTING.md # add single file to index $ git commit -a # adds all changes and commits $ git commit -m "<commit message line here>"
- Use the
-
Push your changes to your forked repository. The first time you push your branch use the
git push -u
command as shown below. Subsequent pushes after further edits can usegit push
(assumes you are working in branch on local repository).# initial push of topic branch $ git push -u origin your-topic-branch # origin is your forked repository # pushes of topic branch after further edits and commits $ git push # defaults to your forked repository
-
Review your change as it appears on your fork of the scalabridge/curriculum repository. Make any additional corrections as needed by repeating steps 3-5 above.
-
- Go to your forked repository on GitHub
- To the right of the Branch menu, click New pull request.
- On the Compare page, click compare across forks.
- Confirm that the base fork is the repository you'd like to merge changes into. Use the base branch drop-down menu to select the branch of the upstream repository you'd like to merge changes into.
- Use the head fork drop-down menu to select your fork, then use the compare branch drop-down menu to select the branch you made your changes in.
- Type a title and description for your pull request.
- If you would like to allow anyone with push access to the upstream repository to make changes to your PR, then select Allow edits from maintainers.
- Click Create pull request.
-
Pull request review by ScalaBridge team members.
- Make revisions as necessary
-
Squash commits and merge into destination branch of ScalaBridge repository.