Open soda4fries opened 3 months ago
Wah your first issue
Before we can make changes, or rather propose changes to the repository, we must first make a fork of the repository to serve as our copy. We will be making our changes to the fork then making pull requests to try and update the repository based on our changes.
A fork is a new repository that shares code and visibility settings with the original “upstream” repository.
- Go to the repository page and click the fork button
You will be directed to a page to confirm and edit the fork of the repository. Just hit the "Create Fork" button at the bottom of the page.
Wait for a bit then you will now have your own fork of the repository.
With the fork that we now have, we can make changes to the fork and try to push them into the original repository by way of making pull requests.
A pull request is a proposal to merge a set of changes from one branch into another. In a pull request, collaborators can review and discuss the proposed set of changes before they integrate the changes into the main codebase.
There are two ways to go about editing and making changes to the fork.
Through GitHub. GitHub allows you to upload files and create new files directly.
Through your own terminal or IDE. VSCode, IntelliJ, NetBeans and all the other common IDEs have Git and version control functionalities integrated that you can use to clone your fork to make changes.
For your initial pull request, head to the "Labs" directory and create a new folder named after your matric number. In GitHub, you can do the following:
After making changes and committing, you can now open a pull request. Go to your fork repository page. If you notice, there is a text now saying that "This branch is X commits ahead of (upstream repository). You can either click the "X commits ahead of" hypertext or the 'Contribute' button and hit 'Open pull request'
You will be directed to a page that shows which branch will be requested to be pulled to what other branch. The differences/changes will also be shown down below, but honestly just hit 'Create pull request' (cause i'm also still learning this stuff 💀 )
Lastly add a title for the pull request and hit 'Create pull request'
Congrats you have now made a pull request and will be added to be a collaborator soon ^^
Now that you are able to make changes to the repository by updating your fork and making pull requests, there is another thing to keep track of. The original repository can and will be updated and these changes will not be automatically added to your fork. So you will need to 'fetch' these new changes into your own fork or copy of the repo.
Fetching is used to retrieve new work done by other people.
git remote add upstream https://github.com/soda4fries/WIA1002_S2_24_occ9
git fetch upstream
git checkout main
git merge upstream/main
Tip: Syncing your fork only updates your local copy of the repository. To update your fork on GitHub.com, you must push your changes.
create a tutorial for the forking and sumitting lab works