scaleracademy / scaler-open-source-september-challenge

335 stars 456 forks source link

Challenge1-MrudangVora-mrudangvora #1

Open mrudang-vora opened 1 year ago

mrudang-vora commented 1 year ago

Completed <Task 1>

name: Mrudang Vora github_user_name: mrudang-vora discord_id: mrudangvora

mrudang-vora commented 1 year ago

Completed <Task 2>

1) Forked the repository using the Github UI of the original repository 2) Cloned the forked repository in the local system using git clone https://github.com/mrudang-vora/scaler-open-source-september-challenge.git

URL of forked repository: https://github.com/mrudang-vora/scaler-open-source-september-challenge

Cloned Repo Screenshot: image

mrudang-vora commented 1 year ago

Completed <Task 3> Created the new branch named mrudangvora-details using the command git branch mrudangvora-details

The attached screenshot shows the list of all the current branches inside the local forked clone repository image

mrudang-vora commented 1 year ago

Completed <Task 4>

1) Configured the forked repository with the original repository using git remote add upstream 2) Fetched the branches from the original repo to the local forked repo using git fetch upstream 3) Checkout the forked repo branch which needs to be synced using git checkout main and git checkout mrudangvora-details 4) Sync the changes from the upstream branch to the forked repo branches using git merge upstream/main

image

mrudang-vora commented 1 year ago

Completed <Task 5> 1) Synced the forked repo's both the branches from the parent repository using the following commands: git fetch upstream git checkout main git merge upstream/main git checkout mrudangvora-details git merge upstream/main

2) Switched to the following branch: git checkout mrudangvora-details

3) Created a new directory inside the contributors folder: mkdir contributors/mrudang-vora/

4) Created and added content in markdown file in the above-created folder: bash -c "nano mrudang-vora.md" Note: We can use bash command in Powershell to execute linux based commands

5) Added the changed file in git trackable files git add .\contributors\mrudang-vora\mrudang-vora.md

6) Commit the change using the commit command while adding the comment for the change: git commit -m "Add mrudang-vora.md in contributors"

7) Push the change from the local to the remote git server using the following command: git push -u origin mrudangvora-details Note: -u (--set-upstream) is added to establish the tracking relationship between the local branch and the remote branch It means next time onwards if you are in that branch and you type git pull or git push, it would understand the relationship and internally execute them as git pull origin <branch_name> or git push origin <branch_name>

8) Now, go to the Github Web and traverse to the parent repository and we should be able to see the yellow banner which gives the option to go to a page where you can compare and create PR.
We need to click on the Create Pull Request button to complete this task. Screenshot 2023-09-05 184529 Screenshot 2023-09-05 184014

mrudang-vora commented 1 year ago

Completed <Task 6>

1) Synced the forked repo's both the branches from the parent repository using the following commands: git fetch upstream git checkout main git merge upstream/main git checkout mrudangvora-details git merge upstream/main

2) Switched to the following branch: git checkout mrudangvora-details

3) Updated the URL of Github Issue in mrudang-vora.md file: bash -c "nano mrudang-vora.md"

4) Added the changed file in trackable file git add .\contributors\mrudang-vora\mrudang-vora.md

5) Commit the change using the commit command while adding the comment for the change: git commit -m "Challenge #6 - Added the Github Issue URL in mrudang-vora.md"

6) Pushed the changes to the remote server using push: git push Note: We have not mentioned the branch as we had used -u option in <Task 5> to establish connection between local and remote branch.

7) Changes are reflected in the same PR created in <Task 5> image image

NOT PART OF CHALLENGE: Updated the comment and removed "#" which was pointing to some other issue by executing the below command: git commit --amend -m "Challenge 6 - Added the Github Issue URL in mrudang-vora.md"

mrudang-vora commented 1 year ago

Completed <Task 7>

1) Synced the forked repo's both the branches from the parent repository using the following commands: git fetch upstream git checkout main git merge upstream/main git checkout mrudangvora-details git merge upstream/main

2) Added new file named "mrudang-vora-2.md" in contributors directory: bash -c "nano mrudang-vora-2.md"

3) Added, Committed and Pushed the changes git add .\contributors\mrudang-vora\mrudang-vora-2.md git commit -m "Challenge 7 - Added mrudang-vora-2.md git push Screenshot 2023-09-08 000728

4) Find the previous commit and reset it to that commit so that the commit is deleted from the list of commits git reset 4c29dea OR we can use a complete hash git reset 4c29dea490ecf2801a0c07d0d39b79492c02d548 Note: git reset (without --hard) performs soft reset - so file created still stays in local branch and directory but it is not tracked

But as per challenge comments, we need to remove the commit from local branch - hence we can use --hard option which deletes the file and does irreversible change. git reset --hard 4c29dea490ecf2801a0c07d0d39b79492c02d548

5) Use push forcefully to remove the commit from the PR created in earlier challenges git push --force Screenshot 2023-09-08 000919

NOT PART OF CHALLENGE: How to recover the reset commit: If we have NOT used --hard, we can use the following command to check the commit history: git reflog This would show all the pointer changes and we can choose to which commit hash we want to go back to. git reset <commit hash you want to go to>

mrudang-vora commented 1 year ago

Completed <Task 8>

1) Synced the forked repo's both the branches from the parent repository using the following commands: git fetch upstream git checkout main git merge upstream/main git checkout mrudangvora-details git merge upstream/main

2) Create a new branch and check it out git branch challenge8 Screenshot 2023-09-09 023722

3) Added a new file named "mrudang-vora-3.md" in contributors directory: bash -c "nano mrudang-vora-3.md" //This is the file created for challenge 8 to learn git rebase and squash concepts

4) Added, Committed, and Pushed the changes git add .\contributors\mrudang-vora\mrudang-vora-3.md git commit -m "Challenge 8 - Added mrudang-vora-3.md" git push -u origin challenge8

mrudang-vora commented 1 year ago

Completed <Task 9> 1) Updated the file named "mrudang-vora-3.md" in contributors directory bash -c "nano mrudang-vora-3.md"

2) Added, Committed, and Pushed the changes git add . git commit -m "Challenge 9 - Modified the file by adding few more lines" git push Screenshot 2023-09-09 170906

3) Checked the latest commits in git log: git log --oneline

4) Now, we need to rebase first 2 commits by squashing them git rebase -i HEAD~2 By mistake, I wrote squash against both the commits in the interactive file. Screenshot 2023-09-09 174103 Screenshot 2023-09-09 175540

Hence, this failed as we had to add squash against only one commit. Then, had to execute the following command to correct the mistake: git rebase --edit-todo git rebase --continue

It opened the interactive window again where I was able to add squash against one of the commits. Once saved, it prompted for the commit message where I accidentally pressed ESC and it successfully rebased on 1st commit message.

Screenshot 2023-09-09 175617

5) Force push the changes to your forked repository. git push --force Screenshot 2023-09-09 180827

mrudang-vora commented 1 year ago

Completed <Task 10> 1) Synced the forked repo branch from the parent repository using the following commands: git checkout mrudangvora-details git fetch upstream git merge upstream/main Screenshot 2023-09-10 201615

2) Added, Committed, and Pushed the changes git add . git commit -m "Challenge 9 - Modified the file by adding few more lines" git push Screenshot 2023-09-10 201545

3) Checked the latest commits in git log: git log --oneline

4) Now, we need to rebase first 2 commits by squashing them git rebase -i HEAD~2 Screenshot 2023-09-10 201505

5) Force push the changes to your forked repository. git push --force Screenshot 2023-09-10 201640

6) We are able to see these commits in PR Screenshot 2023-09-10 203450

mrudang-vora commented 1 year ago

Completed <Task 11> 1) Checkout the mrudangvora-details branch and go to contributors/mrudangvora-details directory and add a new file with content git checkout mrudangvora-details cd C:\Personal\Personal\Mrudang\Scaler\scaler-open-source-september-challenge\contributors\mrudang-vora\ bash -c "nano mrudang-vora-challenge11.md"

2) Now, we can stage the change using git add command git add .

3) We need to now stash the change using stash command git stash

Screenshot 2023-09-11 202446

4) We can access all the stashes using stash list command: git stash list

5) We can access the individual stash by using the following command: git stash show 'stash@{0}' Note: 0 is the index of particular stash in list of stashes

6) Now, we can drop or delete the particular stash entry using the following command: git stash drop 'stash@{0}'

7) We can clear the complete stash using the following command: git stash clear

Screenshot 2023-09-11 202526

mrudang-vora commented 1 year ago

Completed <Task 12> As gpg was not installed on Windows Terminal, have used the git bash for this task as it is by default installed in git bash

1) Check if there are any keys present previously gpg --list-secret-keys --keyid-format=long

2) If there are no keys, need to generate the key using the following command: gpg --full-generate-key Fill in all the details like algorithm name, key size (4096), key should not expire, and confirm the details. Once done, enter the name, email id, and comment to create the key. Please note we need to use no-reply email when performing web-based Git operations, as we have email privacy settings enabled in Github.

Screenshot 2023-09-12 121258

3) Now, we need to get public using the secret key using following command and add the same in the GitHub account: gpg --armor --export A4D1443639440C9C Ref link: https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key

4) Now, we need to add this public key extracted in point 3 in our Github account Screenshot 2023-09-12 140128

5) Now, head on to the git repository and check if there are any gpg settings in git config. git config --get commit.gpgsign If there are none, we need to add the following settings to enable signed commits in the current repository: git config commit.gpgsign true If we want to do it globally, we need to use --global flag in above command

6) Now, get the secret key from gpg --list-secret-keys --keyid-format=long

7) Add this key in git config if not present git config user.signingkey A4D1443639440C9C

8) Now, make the changes in the file mentioned in the task to add the favourite programming language and then add to staged section followed by committing it with "-S" flag indicating the signed commit nano contributors/mrudang-vora/mrudang-vora.md git add contributors/mrudang-vora/mrudang-vora.md git commit -S -m "Challenge 12 - Modified the file to add favourite programming language" Screenshot 2023-09-12 174907

8) Finally, we can push it and see the verified commit in PR too git push Screenshot 2023-09-12 174948

mrudang-vora commented 1 year ago

Completed <Task 13>

1) Created 2 gists

2) Created a new file gist-solutions.md in the mentioned branch git checkout mrudangvora-details bash -c "nano gist-solutions.md" // Add 2 gist URLs git add contributors/mrudang-vora/mrudang-vora.md git commit -S -m "Challenge 13 - Added 2 gists" git push

Screenshot 2023-09-13 235759

Screenshot 2023-09-13 235826

mrudang-vora commented 1 year ago

Completed <Task 14>

1) Modified the file mrudang-vora.md file to include 2 comments in 2 different commits without pushing.

Screenshot 2023-09-14 224521

2) Squashed the 2 commits in 1 commit with the updated comment image

3) Pushed the squash commit in the remote repo and then modified the file again and committed the same.

image

4) Rebased already pushed commit and this committed (but not pushed) commit together and forcefully pushed the changes image

mrudang-vora commented 1 year ago

Completed <Task 15>

  1. Created a new local directory and initialized git in that directory image

  2. Added some content in merge.txt and pushed the commit image

  3. Created a new feature branch and again made changes in the same file image

  4. Again, checkout the main branch, add a few lines in the same file and commit it. Now, when we merge the feature branch to the main, conflict would arise which might not be solved by git automatically. image

  5. Open the file in any editor and resolve conflicts Once resolved, we should be able to push the commit successfully image image

mrudang-vora commented 1 year ago

Completed <Task 16>

1) Synced the forked repo's both the branches from the parent repository using the following commands: git checkout mrudangvora-details git fetch upstream git merge upstream/main Note: We can use git pull instead of 2 commands - Fetch and Merge - Git pull does fetch and merge together. Screenshot 2023-09-17 004420

2) Added name in given format the challenger-list.md

3) Commit and push the change in the remote branch Screenshot 2023-09-17 004527

4) We can see the commit in PR: Screenshot 2023-09-17 004617

mrudang-vora commented 1 year ago

Completed <Task 17>

1) Synced the forked repo's both the branches from the parent repository using the following commands: git checkout mrudangvora-details git fetch upstream git merge upstream/main

Screenshot 2023-09-17 133202

2) When we tried to merge upstream branch with the local branch, we got a conflict that couldn't be merged automatically. Hence, we opened it in a code editor and resolved the conflicts by removing the "conflict-dividers" and kept both the changes. Once done, added the change, committed it, and pushed it to the remote repository Screenshot 2023-09-17 133245

3) Finally, the commits are reflected in PR and it shows the branch has no conflicts now. Screenshot 2023-09-17 135955

mrudang-vora commented 1 year ago

Completed <Task 18>

1) Installed the GitHub Desktop

2) Created a new tutorial repository and added README.md.

3) Used GitHub Desktop for the creation of the branch, committing the changes, and pushing the changes of the feature branch. Screenshot 2023-09-18 111804

Screenshot 2023-09-18 111821

Screenshot 2023-09-18 112944

Screenshot 2023-09-18 113153

4) Created the PR from desktop application Screenshot 2023-09-18 113427

5) Finally, cloned the repo, pulled the main branch, and merged the same with feature branch via CLI Screenshot 2023-09-18 120721

My experience: GitHub Desktop is a simple, easy-to-use application and can be used as an alternative to CLI commands if someone isn't aware. We could rather focus on the application development rather than worrying much about GIT commands. It is definitely better to know CLI commands but not necessary as this application would help cover it up and achieve the task.

mrudang-vora commented 1 year ago

Completed <Task 19>

1) Created the codespace in one of the repositories created earlier - desktop-tutorial for main branch.

2) Explored the features of codespace like branching with codespace and using terminal in codespace. Screenshot 2023-09-19 140740

3) Then made a change in README.md file and committed with terminal and then pushed using VS code. Screenshot 2023-09-19 141405

4) Created the codespace in the current forked repository too and tried to create gpg key to push signed commit but it was somehow unverifed. Screenshot 2023-09-19 223244

My Experience: Getting a cloud code editor was great and you just need to have a laptop and browser to code. But it came with its own challenges like terminal history can't be stored. In local, we usually search in history for reusing the command but here once codespace is restarted, we need to start from square one in case of terminal commands

mrudang-vora commented 1 year ago

Completed <Task 20>

1) Have created a new file for linting the code as soon as something is pushed into the repository Screenshot 2023-09-21 020438

2) Added a new file and committed the same. Was able to see a successful run of the pipeline. Screenshot 2023-09-21 020504

My experience: GitHub Actions seems to be super useful for executing repetitive functionalities using a one-time setup. Would love to explore it more for creating CI CD pipelines

mrudang-vora commented 1 year ago

Completed <Task 21>

1) Created a new Project Board and added a TODO list

2) Added the start and target date

3) Completed a task and pushed a task from TODO to In Progress and then to Done

Screenshot 2023-09-21 145458

Screenshot 2023-09-21 150107

mrudang-vora commented 1 year ago

Completed <Task 22>

1) Explored the "alias" in git config and created an alias for a few commands for the local config file: git config --local alias.co checkout git config --local alias.cms "commit -s -m" git config --local alias.config-get-alias "config --get-regexp alias"

2) Commands in action: git config-get-alias git cms "updated the README.md file with alias cms - commit with sign and message"

Screenshot 2023-09-23 021235

mrudang-vora commented 1 year ago

Completed <Task 23> 1) Added new repository for creating github portfolio and added one of the templates found online. Screenshot 2023-09-24 005519

2) Updated the mrudang-vora.md file to add the github portfolio link as well as repo link. Screenshot 2023-09-24 005457

mrudang-vora commented 1 year ago

Completed <Task 24>

1) Read about CONTRIBUTING.md file and understood the basic steps for making any contribution.

2) Branching naming conventions: We have 2 types of branches: Regular & Temporary

Steps:

ABOUT FIRST CONTRIBUTIONS: Check tags - help wanted or good first issue to initiate the contribution journey Other Web references: https://www.firsttimersonly.com/ https://goodfirstissue.dev/ https://firstcontributions.github.io/

Haven't done any opensource contributions yet but looking forward to the same.

mrudang-vora commented 1 year ago

Completed <Task 25> Have gone through numerous issues but some are already completed while some are archived.

Some other shortlisted issues https://github.com/xunit/xunit/issues/2513 https://github.com/nikohoffren/fork-commit-merge/issues/577

Would still search for a few more in C# PHP and get back by tomorrow. https://up-for-grabs.net/#/filters?date=1week&tags=c%23 https://www.codetriage.com/?language=C%23

mrudang-vora commented 1 year ago

Completed <Task 26> Have started with this basic issue to work on - nikohoffren/fork-commit-merge/issues/577

Would still search for a few more in C# / PHP.

mrudang-vora commented 1 year ago

Completed <Task 27> 1) Have created a feature branch (branch A) and a dev-release branch (branch B) Screenshot 2023-09-27 182504

2) Made changes and committed and pushed to feature branch

3) Cherry-picked and resolved the conflict in dev branch and feature branch Screenshot 2023-09-27 182355

Screenshot 2023-09-28 003852

Screenshot 2023-09-28 003811

mrudang-vora commented 1 year ago

Completed <Task 28> Have completed with this basic issue to work on - nikohoffren/fork-commit-merge/issues/577 Would raise PR probably by tomorrow or max by Saturday Would like to still search for a few more open issues in C# / PHP.

EDIT: Raised the PR - https://github.com/nikohoffren/fork-commit-merge/pull/895

mrudang-vora commented 1 year ago

Completed <Task 29> Update README file of portfolio using the following generator: https://arturssmirnovs.github.io/github-profile-readme-generator/

My file: https://github.com/mrudang-vora/mrudang-vora.github.io/blob/main/README.md

mrudang-vora commented 1 year ago

Completed <Task 30> Have completed all the challenges in Open Source September till date. For open source contribution, have already worked on one of the issues. Would like to search and assign myself some more issues and contribute more. Looking forward for the Hacktober event along with Scaler event to continue this exciting journey of open source contribution