Hello hello, my fellow pink fairy armadillos!
-
To keep updated on our team's code (so probably should do this every day before you start), run
git pull origin Dev -
MAKE SURE TO SWITCH TO YOUR WORKING BRANCH BEFORE MAKING ANY CHANGES!!!
To check what branch you're currently at, you can either look at the bottom left of your VSCode, or run
git branchTo switch to a branch, run
git checkout <your name/branch name>Reminder, no need to include the brackets '<>' and make sure the branch name is accurate (e.g., Kevin vs kevin)
Also, if you want to create and switch to a new branch, run
git checkout -b <new branch name> -
When you want to commit your code, you know the drill
git statusgit add <file-name> or .git commit -m 'your-commit-message' -
Once you're ready to push up, here comes the tricky part! Follow these steps:
- Switch to Dev branch
git checkout Dev- Pull updates of Dev down to your local machine
git pull origin Dev- Switch back to your branch
git checkout <branch-name>- Merge Dev into your branch locally
git merge Dev- Resolve conflicts if there are any
- Push merged branch up to your branch on GitHub
git push origin <branch-name>- On GitHub, there should be a green button saying 'Compare & Create Pull Request'. Make sure it is the correct commit that you want to create the pull request with.
- When creating the pull request, it should be
base: Dev <-- compare: your-branch-name- Make sure it says 'Able to merge' before submitting the pull request!
- Congratulations! Nicely done!