Short of a full tutorial, I'd like to explain how a pull request would work for us. If you don't understand the basics of git/version control and using GitHub to collaborate, please refer to these resources in the README file to get up to speed.
Here is a quick run down of how to contribute to this project.
-
Do not fork my copy! lol Visit GWGweb-projectgroup/practice-project
-
"Fork the repo". This means you have to click the fork icon at the top right of the page. This will make a copy of our project, take you back to your own GitHub account and copy it there. Same project, same files, same everything. Now you can work on the project from your own environment!
- Click the "Clone or download" button. This will give you options for dowloading all the files to your local machine.
- If you want to clone using your terminal, open the terminal, navigate to where you want to dump the files. It will create its own folder so putting it in your [open-source_projects] folder is fine. Copy the link, https://github.com/GWGweb-projectgroup/practice-project.git and in your terminal where you want to put the project type
git clone https://github.com/GWGweb-projectgroup/practice-project.git
and pess Enter. You should now be on the [master] branch of your copy of the project.
In order to stay up to date with what's going on and keeping your master code current, create an upstream to the main project repository so that you can easily pull in the latest changes to your local copy. Doing this will allow you to create a separate branch and work from the most current project state avoiding a lot of complications down the road.
- In your terminal type
git remote add upstream https://github.com/GWGweb-projectgroup/practice-project.git
- Whenever you feel there's been changes to our master, just type
git pull upstream master
and that should pull the current code down from our [master] branch.
- To always have a clean copy to work from, leave your copy's [master] branch alone and create a separate branch to work on by typing
git checkout -b [yourname-dev]
That branch syntax is preferred, but call it whatever you like!
- Now you're free to play around and make changes as you see fit
IMPORTANT: Pull the main repo's [master] branch onto your machine everytime before you begin working on additions, ensuring your working with the latest changes.
- Any serious changes should be committed and pushed to your online GitHub copy of the project repo by typing in the terminal
git push -u origin [this branch name]
The origin
was already created when you cloned this repo and the -u
is creating an upstream to that repo.
- Now whenever you want to push your changes, just type
git push
in that branch and it will do just that
This part usually trips people up, but it's easy
- When you go back to your copy of the repo on GitHub, it will prompt you to make a pull request and allow you to add some message.
IMPORTANT: Make sure your changes are going into to our [dev] branch and not the [master] branch.
- When you click to make the pull request, it will take you to the main repo's copy to compare if you need to and confirm the request. If everything is good to go, you'll see green text confirming that a merge would be successful!
After this, members of the Git Assistance team will review and accept the merge to the [dev] branch. I can help with any part of this process as I am also still learning git and GitHub so bear with me. All I ask is that you either refer to the resources mentioned earlier or get through this quick rundown for making a basic pul request.
-
git pull upstream master
-
git checkout -b [yourname-dev]
-
git push -u origin [this branch name]
-
git push
-
On your branch separate from master,
git merge master
to copy the latest changes after you pull from the upstream (main project repo)