-
Open a Github account
-
Install git on your computer (Git For Windows on Windows)
-
On the top left corner click on the Fork button
Now you have a complete copy of the project on your Github account
-
Open Command Line (Terminal for Mac, Git Bash on Windows) and go to the folder that you want your code to be
-
Set your name and email
$ git config --global user.name "Your Name"
$ git config --global user.email "[email protected]"- Click on the green button saying Clone or Download and copy the https URL. It looks like
https://github.com/<your-user-name>/SummerProject17.git- Use the this URL in the the command below
$ git clone <url>- Your local folder now knows the forked repository. To see this you can type
$git remote -vTo be able to sync with the original repository we have to add that to our remotes too
$git remote add upstream https://github.com/royaa57/SummerProject17Now you have a complte copy on your computer. You have to do the above just once, but the steps below should be done everytime you're working on the code.
- Whenever you start working on a new feature make a new branch.
$git branch <new-branch>Call it something meaningful. For example
$ git branch search_boxor
$ git branch user_profiles- Switch to the new branch
$git chekout <new-branch>- Work on your code, make new folders, add files, modify files. When you're ready add them to the staging area:
$git add <name of the files>or to add everything that is changed
$git add -A- Commit them. Try to use descriptive messages to explain what you did.
$git commit -m "<message>"- Push the changes to your own repository.
$git push --set-upstream origin <new-branch>- Since other people may have contributed to the original repository, you should sync often and certainly before sending a pull request
$git fetch upstream
$git checkout master
$git merge upstream/master- Now go to your github account and push the New Pull Request button,choose the branches, and create a pull request.If the edits are acepted your code will go online.