- Git
- Go
- Mac:
brew install goHomebrew or visit Go - Windows:
choco install goChocolatey - Linux:
sudo apt-get install golang-go
- Mac:
- Click on the
Forkbutton on the top right corner of this page fork the repository to your own GitHub account
- Clone the forked repository to your local machine
git clone <your-forked-repository-url>- Create a new branch from the
mainbranch e.g.maithai-feature - Checkout to the new branch
- Edit the
CONTRIBUTORS.mdfile by adding your name to theContributorssection git statusto see status of the changesgit diffto see the changes- Add the changes to the staging area
git diff --stagedto see the changes in the staging area- Commit the changes
- Checkout to the
mainbranch - Merge the new branch to the
mainbranch - Push the changes to the remote repository at main branch verify by using
git log --graph --oneline. You should see the commit history like below:
* commit C (main): Merge branch 'maithai-feature'
|\
| * commit B (maithai-feature): Implement feature Maithai
|/
* commit A: Initial project setupHint Challenge 1 (try it your self first before open this hint)
- Create a new branch from the
mainbranch e.g.maithai-feature
git branch maithai-feature- Checkout to the new branch
git checkout maithai-feature- Edit the
CONTRIBUTORS.mdfile by adding your name to theContributorssection - Commit the changes
git add CONTRIBUTORS.md
git commit -m "Add my name to the Contributors section"- Checkout to the
mainbranch
git checkout main- Merge the new branch to the
mainbranch
git merge maithai-feature --no-ff- Push the changes to the remote repository at main branch
git push origin main- Create a new branch from the
mainbranch e.g.monkan-feature - Checkout to the new branch
- Edit the
CONTRIBUTORS.mdfile by adding your name to theContributorssection git statusto see status of the changesgit diffto see the changes- Add the changes to the staging area
git diff --stagedto see the changes in the staging area- Commit the changes
- Push the changes to the remote repository at the new branch
- Create a Pull Request from the new branch to your
mainbranch (⚠️ Create PR for your repository) - Merge the Pull Request
- Pull the changes from the remote repository at the
mainbranch - Verify by using
git log --graph --oneline. You should see the commit history like below:
* commit E (HEAD -> main, origin/main): Merge pull request #1 from <your-github-username>/monkan-feature
|\
| * commit C (monkan-feature): Implement feature Monkan
|/
* commit C (main): Merge branch 'maithai-feature'
|\
| * commit B (maithai-feature): Implement feature Maithai
|/
* commit A: Initial project setupHint Challenge 2 (try it your self first before open this hint)
- Create a new branch from the
mainbranch e.g.monkan-feature
git branch monkan-feature- Checkout to the new branch
git checkout monkan-feature- Edit the
CONTRIBUTORS.mdfile by adding your name to theContributorssection - Commit the changes
git add CONTRIBUTORS.md
git commit -m "Add my name to the Contributors section"- Push the changes to the remote repository at the new branch
git push origin monkan-feature- Create a Pull Request from the new branch to the
mainbranch - Merge the Pull Request
- Pull the changes from the remote repository at the
mainbranch
git pull origin mainDon't worry if you are not familiar with Go. You can still complete this challenge by following the guide below.
- Checkout to the
mainbranch - Go to challenge3 directory
cd challenge-3-feature-toggledirectory go run main.goormake go-runand verify the result. You should see Sending via SMS.
Email notification feature toggle is DISABLED
Sending SMS to 0812345678: Hello, Go!⚠️ Unable to run the code?- Install Go by following the Prerequisites section
go versionto verify that Go is installed
- Enable the Email feature by changing
isEmailEnabledinside themainfunction to betrue - Verify the result make sure the email notification is sent to the email address that you specified by using
make go-runthen see the result. - Commit the changes on the
mainbranch - Push the changes to the remote repository at the
mainbranch verify by usingmake go-run. You should see the email notification is sent to the email address that you specified
Email notification feature toggle is ENABLED
Sending email to kbtg@kampus.tech: Hello, Go!Hint Challenge 3 (try it your self first before open this hint)
- Checkout to the
mainbranch
git checkout main- Go to challenge3 directory
cd challenge-3-feature-toggledirectory - Enable the feature by changing the
isEmailEnabledinside themainfunction to betrue - Verify the result make sure the email notification is sent to the email address that you specified
make go-run- Commit the changes on the
mainbranch
git add main.go
git commit -m "Enable email notification feature toggle"- Push the changes to the remote repository at the
mainbranch
git push origin main- Checkout to the
mainbranch - Create a new tag e.g.
v1.0.0 - Push the tag to the remote repository
- Verify by using
git tag. You should see the tag that you created or look at the GitHub repository tag section
v1.0.0Hint Challenge 4 (try it your self first before open this hint)
- Checkout to the
mainbranch
git checkout main- Create a new tag e.g.
v1.0.0
git tag -a v1.0.0 -m "Release version 1.0.0 : send email notification"- Push the tag to the remote repository
git push origin --tags- Checkout to the
mainbranch - Show the commit history
- Pick the commit hash that you want to revert
- Revert the commit (Preserve the history)
Hint Challenge 5 (try it your self first before open this hint)
git revert <commit-hash>- Delete
maithai-featureandmonkan-featurebranch - Push the changes to the remote repository
Hint Challenge 6 (try it your self first before open this hint)
git branch -d maithai-feature
git push origin --delete maithai-feature
git branch -d monkan-feature
git push origin --delete monkan-feature