Posts

Showing posts with the label Git

NPM: Semantic Versioning Characters

Image
  Semantic Versioning Semantic versioning is a solution for the software management term of "Dependency Hell". A software usually depends on other software.  But usually the "other" software also depends also on other products. The illustration above shows a tree of dependencies. Like in the illustration, your software can depend on an other software in different versions. To resolve issues like not to install same dependency multiple times or install the latest version of a software, there is a need of standardized software dependecy management. Semantic versioning standard offers tools like npm or yarn to resolve such dependencies. 📗 BASICS A semantic version consists of three numbers seperated by a dot: 1.1.1 Major Release.Minor Release.Patch Release 🥇Major Release: 2 .1.1 You increase your version to a major release when  your code has breaking changes  the users of your software need to update their code, e.g an API change or sth else which has causes a major...

What is Base, Local & Remote in Git merge

Image
When you use a merge tool for Git and you have conflicts you often see these three versions of a file. This is called the three-way-merge. BASE LOCAL REMOTE So what are these files exactly? Imagine you have a branch. While you're working on the code, someone else has already changed the code in the main branch. Now you'll have a conflict if you merge your code into the main branch. The picture above emphasizes the points that are involved into the merge. GREEN : The common anchestor of the change. This is the BASE. RED : Your changes to the code. This is the REMOTE. ORANGE : The code change of someone else. This is the LOCAL. BLUE : The end result file after the merge. Here a more detailed illustration: Sometimes you will fallback to a two-way merge e.g. in cases where you or the other part deleted a file. Some tools refer them as "ours" or "theirs" ours => LOCAL theirs => REMOTE CONFISUNG NAMES? I personally find the naming confusing because why the h...