Contributing - 2381-robotics/2381-robotics GitHub Wiki
Setup:
- Install git https://git-scm.com/
- Create a local file on your computer
- Right click within the folder, click GITBASH HERE
- In the console,
git clone https://github.com/2381-robotics/2381-robotics.git
Workflow
Before You Start Coding
- In the repository on Github, navigate to Projects > 2381 Website Development
- Under the To-Do tab, pick a project and drag it to the Open tab (this is what you will be working on)
- Navigate back to <>Code in Github, create a new branch and call it the name of the feature you are developing (I.E. Navbar or Community Page etc.)
- On your local file explorer, go to the 2381-website file and GITBASH there
- Create a new branch by using the command
git branch <local branch name>(NOTE: this local branch is a different thing than the branch you created in the cloud, and will be denoted as as opposed to ) - Navigate to the branch you created with
git checkout <local branch name> - Update your local files with
git pull origin <cloud branch name> - Do your work (Code the actual shit)
After Coding
Do this after each time you finish something and after everytime you leave your computer to go do something else. Treat this like a CTRL+S.
- Open GITBASH in the 2381-website file
git add .This adds all of the changes you made into the local gitgit commitThis will open your default text editor (Probably Notepad) Note: When you typegit committhe vim text editor might pop up (the one in the terminal). To type stuff into there, just hiti(insert), when you are done, hitescand type:xto save.- In the text editor add a commit messages detailing the changes that you have made. This is so that other people will be able to understand the stuff you just did. The way this will be formatted is:
- First Line : One sentence summary of changes you have made i.e. (Fixed the scrolling bug + added image files)
- Lines after that : In depth explanation to how did it. This should be able to be understood by other programmers who need revise and change/fix your code in the future. I.E. (Found conflicting style classes for div element, created new div ID to resolve it with width, height, position properties)
- Now all you have to do is send your changes to the cloud with
git push origin <cloud branch name>Note This process should happen several times per project, just like you save an english essay several times before you finish it.
After Finishing A Feature / Project
- Make sure that the finished code/ latest version of your code is in the cloud branch
- In Github, in your branch, click Open Pull Request
- If it isn't already, change Base Repository to 2381-Website
- Make sure the base branch is Master and the compare branch is
<Cloud Branch Name> - Under , list the changes that you have made, go into detail where necessary
- Click NOTE: A Pull Request is completely different from a Pull, and should be called a Merge Request if Github wasn't a small Indie games company. A Pull Request is you saying "Hey, I think I have my shit together and my code is good now, can we merge this into the good copy?". This lets your team check through your code, understand wtf is going on, and make sure your shit isn't spaghetti. Everyone needs to read through everyone else's Pull Requests so that you know whats going on. IT IS EXPECTED FOR EVERYONE TO LEAVE A COMMENT ON ALL PULL REQUESTS SHOWING THAT YOU HAVE READ THROUGH THE CODE. IM GOING WHIP PEOPLE WHO DONT READ THEIR SHIT - YOU HAVE BEEN WARNED