DEV Community

akhan309
akhan309

Posted on

working on my github repository to practice multiple changes in a single project

In this blog post, I am going to discuss working on my github repository to practice multiple changes in a single project.
Following is the repository link I worked on:
https://github.com/alikhan1998/fragments
• Step1: Pick your Features
In this step, I picked following 2 features from a list of provided features:
1- Make sure that program exits with proper error codes.
2- Add support for inline code blocks.
• Step2: Create topic branches:
In github, we have a main (default) branch in which all code is written and all changes also show in same branch. While working on creating issues, I create separate topic branches for each issue:
1- issue1 for feature 1
2- issue2 for feature 2
These branches are made so that the implementation of these features remains separate from main branch and we merge it with main branch when we need it.
• Step3: Implement your features:
I worked on these features in their respective branches.
For appropriate error code feature, I modified the code to exit with appropriate error in all cases considered. If there is no error, code exits with 0. Else, it exits with -1.
For the inline code block feature, I added a new regular expression to the Markdown parser and modified the code to render inline code blocks as HTML.
• Step4: Merge first feature branch:
After completing first branch i.e. issue1, we have to merge it with main branch. For this purpose, we can use 2 ways. Either I use the commands given to us in command prompt or I merge branch directly by opening the branch and click on merge button. I use the second way.
• Step5: Merge second feature branch:
Similarly, after completing second feature branch i.e. issue2, I have to merge it. Same 2 ways as described above are present and I merged this branch by opening it and clicking merge button.
• Step6: Push main branch to github:
After merging branches, I have to push my main branch to github. For this purpose, I used the following cmd command
$git push origin main
• Step7: Close issues:
After pushing main branch, I closed both issues by clicking on them one by one and clicking close issue button. I add the desired comment also on closing.
• Conclusion:
Working on multiple changes in a single project can be challenging, but it is an important skill to have as a software developer. By using topic branches and following a structured workflow, I was able to successfully implement two features in my GitHub repository.
I learned a lot during this process, including how to:
o Create topic branches to isolate changes and make it easier to merge
o Implement features in isolation without affecting the main codebase
o Merge branches and resolve merge conflicts
o Push changes to GitHub and close issues
I am confident that I can apply these skills to future projects to develop and deliver high-quality software.

Top comments (0)