-
Notifications
You must be signed in to change notification settings - Fork 80
GitHub Source Code Management
If you are a developer looking to commit the new changes for your task
- If you have a new idea or feature you want to add that isn't already an existing issue, make sure you talk to a mentor about your idea first, and then you can create a branch
- Make sure you have access to a mentor's github fork of main project
- Make sure to install git in your workstation
Once you have access to the mentor's development branch:
-
Clone your mentor's development branch to your personal machine
git clone --single-branch --branch <branchname> <remote-repo>
-
Create a branch with naming convention of feature/task_name or bugfix/task_name
git checkout -b branch_name
-
Before committing code:
- Remove any local machine references
- Variable are named aptly (GoodVariable:
combatAntCharacteristics
, Bad Variable:x
) - Variables follow camelCase (
goodVariable
,badvariable
)
-
Then change the code or add the new files and commit the code.
git add fileName && git commit -m “Message about the changes”
. Make sure the message is clear about what the purpose is. -
Then push the code to the mentors upstream repository.
git push --set-upstream origin branchName
---> (needs to be done only once.) -
Do a pull request to the development branch of your mentor's repository.
-
Send a Message to the mentor about the changes.
-
Go to your PR on github.com and choose a label for your PR
Before you send the code PR to the organizational Branch, here are the key things you need to consider before accepting the changes:
- Make sure your master is protected from the unwanted pushes, by going into the setting of your repo.
- Select the settings tab
- Select branches from the sidebar.
- Click on the add rule add branch name pattern as master.
- Then select create to create a rule, this will allow any changes to be not pushed directly into master.
- Do the same for the development branch.
- Check the new PR raised by your mentee for code quality, consistent naming pattern, good comments and syntax errors.
- Once you think code is looking good, raise a pull request to the Organizational development Branch, GitHub settings require 5 approval reviews before merging.
- Once the code passes all the reviewer's review, then it is merged to development branch.
- The code will be tested on a couple of other machines, once successful the mentee branch is merged to your master branch, then accept the PR and notify all your mentee about the new master changes. Ask them to re-base their branches according to master to maintain good timeline in commits.
- Then raise a PR from your master branch to the organizational Development branch.
Please follow the steps listed for syncing a fork
Master Branch (master): This branch is the main code branch should always be stable and should accept pull request or merges only after the new pull requests are tested and tests are passed.
Development Branch (Development): This is the branch that contains changes from the new members which may or may not be stable, mentors should always do pull request to this branch. Once the multiple people test (probably a couple of mentors), the team mentor will submit the pull request to the master branch.
- To learn about the fundamentals of GIT: http://gitimmersion.com/
- To learn about git branching in general: https://learngitbranching.js.org/