- Github Account
- Git
- On Windows: Make sure you set "Visual Studio Code" as your editor during setup.
- Visual Studio Code
- Github CLI
When using git, there are various stages your files can be in: untracked, modified, staged and committed.
Untracked: New files that have been added to your project directory.
Modified: Files that have been edited since your last commit.
Staged: Files that have been marked as ready to be included in the next commit.
Committed: Changes have been synced with your local git repository.
Pushed: Changes are now synced with the remote repository and all collaborators.
Have a go at modifying the sample website. If you haven't used HTML before, use the link below for sample HTML syntax.
Ideas:
- Cat Newspaper
- Write some news about Superman
Merge conflicts occur when multiple people make changes to the same lines in a file. They show you what currently exists and your incoming change and you have to resolve it manually. Inducing a merge conflict
To learn how to resolve merge conflicts, we can force a merge conflict manually. This can be done as a group or individually if you're just following along by yourself.
-
2 People should each create a new branch using
git switch -c
-
Both people should stage and commit their changes, ensuring they change the same line in different ways
-
Both people open a pull request
-
Merge one of the pull requests
-
Trying to merge using gh pr merge for the second branch should now fail.
-
The other person will be shown by GitHub CLI how to solve the merge conflict. Once it's resolved they'll be able to merge their branch with main!