<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Version Control on Sandra Ashipala</title><link>https://sandramsc-fun.sandraashipala.workers.dev/categories/version-control/</link><description>Recent content in Version Control on Sandra Ashipala</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Tue, 15 Aug 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://sandramsc-fun.sandraashipala.workers.dev/categories/version-control/index.xml" rel="self" type="application/rss+xml"/><item><title>Maximising Efficiency with Node.js and NVM</title><link>https://sandramsc-fun.sandraashipala.workers.dev/post/maximising-efficiency/</link><pubDate>Tue, 15 Aug 2023 00:00:00 +0000</pubDate><guid>https://sandramsc-fun.sandraashipala.workers.dev/post/maximising-efficiency/</guid><description>&lt;img src="https://sandramsc-fun.sandraashipala.workers.dev/post/maximising-efficiency/featured.jpg" alt="Featured image of post Maximising Efficiency with Node.js and NVM" />&lt;p>&lt;strong>An all-inclusive intro guide&lt;/strong>&lt;/p>
&lt;h2 id="introduction">Introduction
&lt;/h2>&lt;p>Node.js has revolutionized the way server-side applications are built. With its event-driven architecture and extensive module ecosystem, Node.js enables developers to create highly scalable and performant applications. However, managing several versions of Node.js can be challenging, making it difficult to get started. This is where Node Version Manager (NVM) comes into play, providing developers with a seamless solution for version control.&lt;/p>
&lt;p>This post will delve into the world of Node.js and NVM, exploring their functionalities, benefits, and how they work together to enhance the workflow of development projects.&lt;/p>
&lt;h2 id="overview-of-nodejs-and-nvm">Overview of Node.js and NVM
&lt;/h2>&lt;h3 id="what-is-nodejs">What is Node.js?
&lt;/h3>&lt;p>Node.js is an open-source, cross-platform JavaScript runtime environment built on Chrome&amp;rsquo;s V8 JavaScript engine. Unlike traditional server-side technologies, Node.js allows developers to execute JavaScript code on the server, bringing the language to the backend. By leveraging an event-driven, non-blocking I/O model, Node.js achieves exceptional scalability and efficiently handles concurrent requests. It has gained immense popularity in building real-time applications, APIs, microservices, as well as full-stack web applications.&lt;/p>
&lt;h3 id="key-features-and-benefits-of-nodejs">Key features and benefits of Node.js
&lt;/h3>&lt;ul>
&lt;li>&lt;strong>Vast Ecosystem:&lt;/strong> Node.js boasts a massive ecosystem of reusable modules known as npm (Node Package Manager). With over a million packages available, developers can easily integrate existing solutions into their projects, saving valuable development time.&lt;/li>
&lt;li>&lt;strong>Fast Execution:&lt;/strong> Node.js leverages the V8 JavaScript engine, renowned for its high-performance execution. This results in rapid code execution and optimized resource utilization.&lt;/li>
&lt;li>&lt;strong>Scalability:&lt;/strong> Node.js enables the creation of scalable applications, thanks to its ability to handle a large number of concurrent connections efficiently. This makes it well-suited for building applications with high traffic demands.&lt;/li>
&lt;/ul>
&lt;h3 id="what-is-node-version-manager-nvm">What is Node Version Manager (NVM)?
&lt;/h3>&lt;p>Managing multiple versions of Node.js on a single machine can be challenging, especially when different projects require different versions. Node Version Manager (NVM) provides a seamless solution to this problem. It is a command-line tool that allows developers to install, switch, and manage multiple Node.js versions effortlessly. NVM provides a consistent environment for development, ensuring that projects run on the required Node.js version without conflicts.&lt;/p>
&lt;h3 id="key-features-and-benefits-of-nvm">Key features and benefits of NVM
&lt;/h3>&lt;ul>
&lt;li>&lt;strong>Version Control:&lt;/strong> NVM allows developers to install and switch between multiple Node.js versions, ensuring compatibility with different projects. It provides flexibility without the need for manual installations and avoids conflicts between projects that rely on different Node.js versions.&lt;/li>
&lt;li>&lt;strong>Project Isolation:&lt;/strong> With NVM, each project can have its own isolated environment with a specific Node.js version and set of dependencies. This avoids clashes between project dependencies and ensures consistent behaviour across different projects.&lt;/li>
&lt;li>&lt;strong>Easy Installation and Upgrades:&lt;/strong> NVM simplifies the process of installing and upgrading Node.js versions. It provides a straightforward command-line interface to manage versions, making it easy to stay up-to-date with the latest releases.&lt;/li>
&lt;/ul>
&lt;p>&lt;img src="https://sandramsc-fun.sandraashipala.workers.dev/post/maximising-efficiency/image_0.jpg"
width="1230"
height="320"
srcset="https://sandramsc-fun.sandraashipala.workers.dev/post/maximising-efficiency/image_0_hu_2a61c8d544413534.jpg 480w, https://sandramsc-fun.sandraashipala.workers.dev/post/maximising-efficiency/image_0_hu_17655cf27ebf7af6.jpg 1024w"
loading="lazy"
alt="Illustration"
class="gallery-image"
data-flex-grow="384"
data-flex-basis="922px"
>&lt;/p>
&lt;p>NVM usage illustration&lt;/p>
&lt;blockquote>
&lt;p>&lt;strong>Note ✍🏾:&lt;/strong> To switch between different versions of Node.js, navigate to your terminal and type &lt;code>nvm [node version number]&lt;/code>: i.e. &lt;code>nvm 16.17.1&lt;/code>&lt;/p>&lt;/blockquote>
&lt;p>Now that you&amp;rsquo;re familiar with Node.js and NVM, this next section will guide you through the step-by-step process of setting up Node.js and NVM on your local machine. Let&amp;rsquo;s get started!&lt;/p>
&lt;h2 id="installing-nodejs-and-nvm">Installing Node.js and NVM
&lt;/h2>&lt;h3 id="step-1-install-nvm">Step 1: Install NVM
&lt;/h3>&lt;p>1.1. Visit the NVM GitHub repository at &lt;a class="link" href="https://github.com/nvm-sh/nvm" target="_blank" rel="noopener"
>https://github.com/nvm-sh/nvm&lt;/a>.&lt;/p>
&lt;p>1.2. Look for the installation instructions in the README file. As of now, the recommended method is to use the installation script. You can find the script under the section &amp;ldquo;Install &amp;amp; Update Script.&amp;rdquo;&lt;/p>
&lt;p>1.3. Copy the installation script. It should look something like this:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">curl -o- &lt;span class="o">[&lt;/span>https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh&lt;span class="o">](&lt;/span>https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh&lt;span class="o">)&lt;/span> &lt;span class="p">|&lt;/span> bash
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div></description></item><item><title>7 Key Concepts and Features of Version Control</title><link>https://sandramsc-fun.sandraashipala.workers.dev/post/version-control/</link><pubDate>Mon, 14 Aug 2023 00:00:00 +0000</pubDate><guid>https://sandramsc-fun.sandraashipala.workers.dev/post/version-control/</guid><description>&lt;img src="https://sandramsc-fun.sandraashipala.workers.dev/post/version-control/featured.jpg" alt="Featured image of post 7 Key Concepts and Features of Version Control" />&lt;h2 id="introduction">Introduction
&lt;/h2>&lt;p>Version control is a practice that allows you to manage and track changes to files or a set of files over time. As a software development tool, it is commonly used for managing documents, spreadsheets, and multimedia files.&lt;/p>
&lt;p>Version Control Systems keep a history of changes made to files, enabling you to access previous versions, compare differences, and revert to earlier states if needed. As a result, they facilitate structured and organized collaboration, particularly when multiple individuals are working on the same set of documents at the same time. This post will highlight 7 key concepts and features that are most frequently associated with Version Control in the context of software development/engineering.&lt;/p>
&lt;h2 id="key-concepts-and-features">Key concepts and features
&lt;/h2>&lt;h3 id="repository">Repository
&lt;/h3>&lt;p>A repository is a central storage location where all versions and changes to files are stored; it also contains the project&amp;rsquo;s history.&lt;/p>
&lt;h3 id="commit">Commit
&lt;/h3>&lt;p>A commit is an entry in the file representing one particular change or a set of changes. Each commit is associated with a unique identifier and includes a message describing the changes.&lt;/p>
&lt;h3 id="branches">Branches
&lt;/h3>&lt;p>Branches can be created within a repository to separate lines of development. In this way, multiple users are able to work on different features or experiments simultaneously without interfering with one another&amp;rsquo;s work. Branches can be merged back together later.&lt;/p>
&lt;h3 id="merging">Merging
&lt;/h3>&lt;p>Merging is the process of combining changes from one branch to another. It allows you to integrate changes made in separate branches back into the main branch or other designated branches.&lt;/p>
&lt;h3 id="diffing">Diffing
&lt;/h3>&lt;p>Diffing refers to the ability to compare the differences between two versions of a file or between branches. It shows the additions, deletions, and modifications made to the content.&lt;/p>
&lt;h3 id="conflict-resolution">Conflict resolution
&lt;/h3>&lt;p>When multiple people make conflicting changes to the same file or code section, a conflict occurs. Version control systems provide tools to help resolve these conflicts, ensuring that changes are merged correctly.&lt;/p>
&lt;h3 id="history-and-annotations">History and annotations
&lt;/h3>&lt;p>Version control systems maintain a detailed history of all changes, including who made each change and when. Using annotations, you can identify who wrote specific lines or sections of a document.&lt;/p>
&lt;h2 id="conclusion">Conclusion
&lt;/h2>&lt;p>Commonly used version control systems include Subversion, Git and Mercurial. These systems offer powerful features for collaboration, code management, and project organization, making them essential tools for software development teams.&lt;/p>
&lt;p>&lt;img src="https://sandramsc-fun.sandraashipala.workers.dev/image_0.jpg"
loading="lazy"
alt="Illustration"
>&lt;/p>
&lt;p>Thanks for reading. Happy Coding!&lt;/p></description></item><item><title>Git Commands</title><link>https://sandramsc-fun.sandraashipala.workers.dev/post/git-commands/</link><pubDate>Mon, 14 Aug 2023 00:00:00 +0000</pubDate><guid>https://sandramsc-fun.sandraashipala.workers.dev/post/git-commands/</guid><description>&lt;img src="https://sandramsc-fun.sandraashipala.workers.dev/post/git-commands/featured.jpg" alt="Featured image of post Git Commands" />&lt;p>&lt;strong>A quick guide - to keep handy&lt;/strong>&lt;/p>
&lt;h2 id="introduction">Introduction
&lt;/h2>&lt;p>Git is a powerful version control system that allows developers (and professionals who might benefit from the tool) to track changes, collaborate on projects, and manage code efficiently (you can learn more about version control here). In this post, we will cover a few of the most frequently used Git commands (at least the ones I use most often in development) and outline their basic functionalities.&lt;/p>
&lt;h2 id="list-of-git-commands">List of Git commands
&lt;/h2>&lt;h3 id="git-init">&lt;code>git init&lt;/code>
&lt;/h3>&lt;p>The &lt;code>git init&lt;/code> command initializes a new Git repository in your current working directory. It creates a hidden “.git” folder that contains the necessary data for version control.&lt;/p>
&lt;h3 id="git-clone-repository_url">&lt;code>git clone [repository_url]&lt;/code>
&lt;/h3>&lt;p>The &lt;code>git clone&lt;/code> command allows you to copy an existing Git repository from a remote source, such as GitHub. It downloads the entire repository, including its history, to your local machine.&lt;/p>
&lt;h3 id="git-add-files">&lt;code>git add [file(s)]&lt;/code>
&lt;/h3>&lt;p>The &lt;code>git add&lt;/code> command stages file(s) for the next commit. You can specify individual files or directories. Use &lt;code>git add .&lt;/code> , to stage all modified files in the current director.&lt;/p>
&lt;h3 id="git-status">&lt;code>git status&lt;/code>
&lt;/h3>&lt;p>The &lt;code>git status&lt;/code> command displays the current status of your repository. It shows which files have been modified, staged, or untracked. This command is helpful for understanding the state of your project.&lt;/p>
&lt;h3 id="git-log">&lt;code>git log&lt;/code>
&lt;/h3>&lt;p>The &lt;code>git log&lt;/code> command shows a chronological list of commits in the repository. It displays information such as the commit hash, author, date, and commit message. Use &lt;code>git log --oneline&lt;/code> for a more concise view.&lt;/p>
&lt;h3 id="git-pull-remotebranch">&lt;code>git pull [remote][branch]&lt;/code>
&lt;/h3>&lt;p>The &lt;code>git pull&lt;/code> command fetches and merges changes from a remote repository into your local branch. It is used to update your local branch with the latest changes made by others. Note that you’d need to specify the remote and branch to pull from.&lt;/p>
&lt;h3 id="git-branch">&lt;code>git branch&lt;/code>
&lt;/h3>&lt;p>The &lt;code>git branch&lt;/code> command lists all branches in your repository. It also highlights the branch you are currently on. Use &lt;code>git branch [branch_name]&lt;/code> to create a new branch.&lt;/p>
&lt;h3 id="git-checkout-branch_name">&lt;code>git checkout [branch_name]&lt;/code>
&lt;/h3>&lt;p>The &lt;code>git checkout&lt;/code> command combines changes from one branch into another. It integrates the changes from the specified branch into the current branch. This is useful when you want to incorporate features or bug fixes from one branch into another.&lt;/p>
&lt;h3 id="git-merge-branch">&lt;code>git merge [branch]&lt;/code>
&lt;/h3>&lt;p>The &lt;code>git merge&lt;/code> command combines changes from one branch into another. It integrates the changes from the specified branch into the current branch. This is useful when you want to incorporate features or bug fixes from one branch into another.&lt;/p>
&lt;h3 id="git-remote">&lt;code>git remote&lt;/code>
&lt;/h3>&lt;p>The &lt;code>git remote&lt;/code> command lists the remote repositories associated with your local repository. It shows their names, URL’s and other information. You can add new remotes using &lt;code>git remote add [name][url]&lt;/code>.&lt;/p>
&lt;h2 id="conclusion">Conclusion
&lt;/h2>&lt;p>Having an understanding of these commands will greatly enhance your ability to manage and collaborate on projects effectively. It can also be convenient to have these in one place so as to access them with ease when you need to.&lt;/p>
&lt;p>Thanks for reading. Happy Coding!&lt;/p></description></item></channel></rss>