-
Notifications
You must be signed in to change notification settings - Fork 1
Using GitHub
Christof Steyn edited this page May 7, 2023
·
3 revisions
- Do not commit anything to main/master unless widely discussed with others and everyone has agreed.
- If you have a merge conflict or any issue don't just delete, ask someone for help.
This document will look at working with GitHub desktop, VS Code (terminal and extension) and IntelliJ
- Check that you are the correct repository in the top left.
- Check that you are in the correct branch
- you can create a branch if you feel you need to, however ensure that the branch doesn't already exist.
- when creating branches name correctly:
- feature branches get feature/branchname
- front end branches get front-end/branchname
- etc.
- If there are local changes to the branch pull them. (Big blue "pull" notification)
- Fetching origin will fetch any changes to the remote repo. (Won't download just checking if there are updates)
- Open in VS Code (button in the middle)
- Once you have started coding:
- you will be able to see any changes made in GitHub desktop
- you can stash any changes in GitHub desktop (This means that the changes you've made will be saved and you can pull into your current branch)
- once finished coding commit your work on GitHub desktop
- you will need to supply a Summary heading and message when committing
- ensure that your message isn't longer than 50 characters (the less, the better), explain what and why.
- Push commits
- Open the copied folder in VS Code. This should automatically activate git.
- If you have never done this before sign into your git account using either in the terminal:
- $ git config --global user.name "Your name here"
- $ git config --global user.email "user.email"
- Ensure that the source control in VS Code (3rd icon from the top on the left) shows "message" and "commit".
- In the terminal type "git branch", the branch you are in will have a star next to it.
- If you are not in the branch that you should be working in then in the terminal type "git checkout 'branchname'".
- Ensure you're in the correct branch.
- If a branch you are looking for isn't there try "git fetch origin" and try again
- In the terminal type git status, if you are not 'up to date' type "git pull"
- Once finished coding, your changes should show in the source control tab.
- You can stash, stage and commit your changes in the source control tab.
- VS Code also provides an interface to view merge conflicts.
- Download the IntelliJ Ultimate edition from the Jetbrains website:
https://www.jetbrains.com/idea/download/#section=windows
- When launching IntelliJ for the first time, press the login link at the bottom left of the popup.
- Login using your student email and password
- On the welcome page click the "Get from VCS" option.
- Enter the repository URL and choose where to save the project locally.
- Check that you are in the correct branch. The current branch is shown on the bottom right of IntelliJ.
- By clicking on the branch you can also change to another branch or even create a new one to work on.
- To fetch and pull updates from the repo, simply click the blue arrow on the top right and select the "merge incoming changes" option.
- To commit changes, simply click the green check symbol on the top right corner. This will bring up a changes tab on the left where you can see the modified/added data. Also provide a Short and detailed commit message that states what you have changed.
- Either commit and push directly to the branch or commit and push later by clicking the green arrow on the top right corner of IntelliJ.
If you run into a merge conflict message, and you don't understand the conflicts once viewing them, contact the person who may be responsible for the changes (can be view in commit history) or contact the project manager.
Please feel free to contact us directly at our email address should you require any further information