Learning to merge different branches

Overview
This week I have learnt a new git feature which was merging. In more details, I have worked with parallel branches, one for adding -l flag and the other was updating the Markdown support function.

Firstly, I created a new function to add the …


This content originally appeared on DEV Community and was authored by Hung Nguyen

Overview
This week I have learnt a new git feature which was merging. In more details, I have worked with parallel branches, one for adding -l flag and the other was updating the Markdown support function.

Firstly, I created a new function to add the -l,--lang flag to my project. This flag will allow the users to modify the lang="" in the html tag. For example:

osdssg -i hello.txt -l fr

My program will create a new html file with

<html lang="fr">

Another new feature is if users input a markdown file, my tool now can convert any --- into hr tag.

---This text is in markdown file

Will be converted into

<hr /><p>This text is in markdown file</p>

Issues
I did not have really important issues, but I did remove some redundant codes from previous weeks such as some testing console.log or some comments.

When I did the merging, my 2 branches were merged smoothly without any conflict. But I would like to practice more on this feature, so I added some console.log tests on both branches in order to have the conflict. Yeah, the Git complained about the conflict, I did some changes and finally I push every thing to the main.

Final thought
This feature is really interesting since it helps you well when you work as a team or if you work with the same project with different tasks. However, I think this week's lab is not enough for me to learn the merging of Git. Probably in the future, I need to separate the branches in my projects so that I can see more problem then I can learn more.

Project repo: https://github.com/nguyenhung15913/OSD600-SSG
Issue-11: https://github.com/nguyenhung15913/OSD600-SSG/issues/12
Final merge main with issue-11: https://github.com/nguyenhung15913/OSD600-SSG/commit/c9f72f123133250897eef3e27a0f5c0df3e3145d#diff-e8ba56b7852a747928456dd8ad6bc1c92a747d806b5feb04e59563044567484c
Issue-12:https://github.com/nguyenhung15913/OSD600-SSG/issues/13
Final merge main with issue-12: https://github.com/nguyenhung15913/OSD600-SSG/commit/72efea5358c4b1423e1b7394d286b225930dc785#diff-e8ba56b7852a747928456dd8ad6bc1c92a747d806b5feb04e59563044567484c


This content originally appeared on DEV Community and was authored by Hung Nguyen


Print Share Comment Cite Upload Translate Updates
APA

Hung Nguyen | Sciencx (2021-10-01T20:44:06+00:00) Learning to merge different branches. Retrieved from https://www.scien.cx/2021/10/01/learning-to-merge-different-branches/

MLA
" » Learning to merge different branches." Hung Nguyen | Sciencx - Friday October 1, 2021, https://www.scien.cx/2021/10/01/learning-to-merge-different-branches/
HARVARD
Hung Nguyen | Sciencx Friday October 1, 2021 » Learning to merge different branches., viewed ,<https://www.scien.cx/2021/10/01/learning-to-merge-different-branches/>
VANCOUVER
Hung Nguyen | Sciencx - » Learning to merge different branches. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/10/01/learning-to-merge-different-branches/
CHICAGO
" » Learning to merge different branches." Hung Nguyen | Sciencx - Accessed . https://www.scien.cx/2021/10/01/learning-to-merge-different-branches/
IEEE
" » Learning to merge different branches." Hung Nguyen | Sciencx [Online]. Available: https://www.scien.cx/2021/10/01/learning-to-merge-different-branches/. [Accessed: ]
rf:citation
» Learning to merge different branches | Hung Nguyen | Sciencx | https://www.scien.cx/2021/10/01/learning-to-merge-different-branches/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.