DEV Community

Avelyn Hyunjeong Choi
Avelyn Hyunjeong Choi

Posted on

Process of working in parallel branches in GitHub

GitHup Repo:https://github.com/avelynhc/til_tracker

Changes made for new features

In the first issue, users can now specify their desired language for the generated HTML files by using the optional argument -l or --lang.

This feature was implemented by adding a new argument option -l or --lang in yargs as below.

.option("l", {
     alias: "lang",
     describe: "Language used in generated file",
     default: "en-CA",
     type: "string",
     demandOption: false,
})
Enter fullscreen mode Exit fullscreen mode

Once the app receives the language argument by the user, it will be passed to other methods, including , including readFile(), readFolder(), and convertToHTML().

In convertToHTML()method,

<!doctype html>
<html lang="${userInput}">
...
</html>
Enter fullscreen mode Exit fullscreen mode

userInput will be replaced with actual user input.
This issue was closed by merge commit.

In the second issue, it was ensured that the program exits with appropriate error codes in all cases by using process.exit(-1).

For example,

fs.stat(argv.input, (err: any, stats: { isDirectory: () => any; isFile: () => any; }) => {
    if (err) {
        console.error(err);
        process.exit(-1);
    }
...
});
Enter fullscreen mode Exit fullscreen mode

This issue was closed by merge commit.

Process of doing merges

The first merge with the first branch (issue-6) went smoothly, but when attempting the second merge with the second branch (issue-7), a conflict arose. I had to go through the files with merge conflicts one by one, selecting the code I wanted to proceed with. After resolving the merge conflict, I pushed the final code to GitHub.

Problem I had

When changes in one branch conflicted with those in another, I initially struggled to find a solution. I turned to online resources and managed to resolve the issue. It involved identifying a few lines of conflicting code and carefully modifying them one by one. This experience demanded meticulous attention to details.

Learning opportunity

I learned how to create, manage, and merge branches efficiently, improving my proficiency in GitHub. Additionally, reviewing and providing feedback on code changes in parallel branches helped me develop code review skills and encouraged a deeper understanding of others' work. Overall, working in parallel branches in GitHub was a rich learning experience, honing my skills in version control, collaboration, risk management, and other critical aspects of software development.

What I would do differently next time

I felt overwhelmed when I had numerous branches in GitHub, so I would opt for more descriptive and standardized branch names to enhance clarity and facilitate easier identification of their purpose. Additionally, I encountered some challenges with merging conflicts while working on this project. In the future, I would prioritize addressing merge conflicts promptly and comprehensively to prevent prolonged delays in the development process.

Top comments (0)