{"@attributes":{"version":"2.0"},"channel":{"title":"gitx","link":"https:\/\/gitxtui.github.io\/docs\/","description":"Recent content on gitx","generator":"Hugo","language":"en","item":[{"title":"Basics","link":"https:\/\/gitxtui.github.io\/docs\/learn\/getting-started\/02_using_gitx\/01_basics\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/getting-started\/02_using_gitx\/01_basics\/","description":{}},{"title":"Installing gitx","link":"https:\/\/gitxtui.github.io\/docs\/learn\/getting-started\/01_installing_gitx\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/getting-started\/01_installing_gitx\/","description":"<h2 id=\"installation-script\">Installation Script<a class=\"td-heading-self-link\" href=\"#installation-script\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>The easiest way to install <code>gitx<\/code> is by using the installation script. Open your terminal and run the following command:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">curl -sSL https:\/\/raw.githubusercontent.com\/gitxtui\/gitx\/master\/install.sh <span class=\"p\">|<\/span> bash\n<\/span><\/span><\/code><\/pre><\/div><p>This script will automatically detect your operating system and architecture, download the latest release of gitx, and install it to <code>\/usr\/local\/bin<\/code>.<\/p>\n<h2 id=\"using-go-install\">Using go install<a class=\"td-heading-self-link\" href=\"#using-go-install\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>Requires <code>go<\/code> to be installed on your system:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">go install github.com\/gitxtui\/gitx\/cmd\/gitx@latest\n<\/span><\/span><\/code><\/pre><\/div><p>This will download the correct binary according to your operating system and place it at <code>~\/go\/bin\/gitx<\/code>.<\/p>"},{"title":"Introduction to Git","link":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/01_introduction_git\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/01_introduction_git\/","description":"<blockquote>\n<p><strong>Git<\/strong> is an open source, distributed version control system (VCS) that helps you track changes in your code and collaborate with others efficiently.<\/p><\/blockquote>\n<hr>\n<p>Imagine you\u2019re writing a book. You make changes every day\u2014sometimes adding new chapters, sometimes fixing typos. After a few weeks, you wonder: <em>What if I want to see the old draft? What if two people are editing the same chapter?<\/em><\/p>\n<p>This is where <strong>Git<\/strong> comes in.<\/p>"},{"title":"Overview","link":"https:\/\/gitxtui.github.io\/docs\/learn\/overview\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/overview\/","description":"<!-- \n\n<div class=\"pageinfo pageinfo-primary\">\n<p>This is a placeholder page that shows you how to use this template site.<\/p>\n\n<\/div>\n -->\n<h2 id=\"what-is-it\">What is it?<a class=\"td-heading-self-link\" href=\"#what-is-it\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>gitx is a Terminal User Interface (TUI) helper designed to simplify the process of learning and using Git, the most widely used version control system (VCS). Instead of typing long and often confusing commands, gitx presents a more guided and interactive interface that helps beginners understand Git concepts while still working inside the terminal. It is especially useful for students, new developers, or anyone who wants to strengthen their Git fundamentals by not only providing an easy access to all the git functions but also educating about doing all the said exercises manually.<\/p>"},{"title":"Project Roadmap","link":"https:\/\/gitxtui.github.io\/docs\/contribute\/roadmap\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/contribute\/roadmap\/","description":"<style>\n.roadmap-container {\n margin: 2rem 0;\n}\n\n.roadmap-section {\n position: relative;\n padding: 1.5rem;\n margin-bottom: 2rem;\n border-left: 4px solid;\n border-radius: 4px;\n transition: background-color 0.3s, border-color 0.3s;\n}\n\n\/* Light theme *\/\n.roadmap-section.done {\n border-color: #28a745;\n background: #f0f9f4;\n}\n\n.roadmap-section.active {\n border-color: #007bff;\n background: #e7f3ff;\n}\n\n.roadmap-section.planned {\n border-color: #6c757d;\n background: #f8f9fa;\n}\n\n\/* Dark theme *\/\n@media (prefers-color-scheme: dark) {\n .roadmap-section.done {\n border-color: #4ade80;\n background: rgba(74, 222, 128, 0.1);\n }\n\n .roadmap-section.active {\n border-color: #3b82f6;\n background: rgba(59, 130, 246, 0.1);\n }\n\n .roadmap-section.planned {\n border-color: #9ca3af;\n background: rgba(156, 163, 175, 0.1);\n }\n}\n\n\/* Docsy dark mode class support *\/\n.td-dark .roadmap-section.done {\n border-color: #4ade80;\n background: rgba(74, 222, 128, 0.1);\n}\n\n.td-dark .roadmap-section.active {\n border-color: #3b82f6;\n background: rgba(59, 130, 246, 0.1);\n}\n\n.td-dark .roadmap-section.planned {\n border-color: #9ca3af;\n background: rgba(156, 163, 175, 0.1);\n}\n\n.roadmap-section h3 {\n margin-top: 0;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n}\n\n.roadmap-section ul {\n margin-bottom: 0;\n}\n\n.roadmap-section li {\n margin: 0.75rem 0;\n}\n\n.status-badge {\n display: inline-block;\n padding: 0.25rem 0.75rem;\n border-radius: 12px;\n font-size: 0.85rem;\n font-weight: 600;\n}\n\n\/* Light theme badges *\/\n.status-badge.done {\n background: #28a745;\n color: white;\n}\n\n.status-badge.active {\n background: #007bff;\n color: white;\n}\n\n.status-badge.planned {\n background: #6c757d;\n color: white;\n}\n\n\/* Dark theme badges *\/\n@media (prefers-color-scheme: dark) {\n .status-badge.done {\n background: #4ade80;\n color: #0f172a;\n }\n\n .status-badge.active {\n background: #3b82f6;\n color: white;\n }\n\n .status-badge.planned {\n background: #9ca3af;\n color: #0f172a;\n }\n}\n\n\/* Docsy dark mode class support for badges *\/\n.td-dark .status-badge.done {\n background: #4ade80;\n color: #0f172a;\n}\n\n.td-dark .status-badge.active {\n background: #3b82f6;\n color: white;\n}\n\n.td-dark .status-badge.planned {\n background: #9ca3af;\n color: #0f172a;\n}\n<\/style>\n<div class=\"roadmap-container\">\n<div class=\"roadmap-section done\">\n <h3>\u2705 Completed <span class=\"status-badge done\">Done<\/span><\/h3>\n <ul>\n <li><strong>Basic TUI Structure:<\/strong> A foundational terminal user interface is in place, providing the core layout and panel management for the application.<\/li>\n <li><strong>Git Command Mapping:<\/strong> Essential Git commands are integrated into the TUI, allowing users to perform basic operations visually.<\/li>\n <li><strong>Theme Generation:<\/strong> The application can generate themes from a predefined set of color palettes, allowing for initial UI customization.<\/li>\n <li><strong>Custom Theme Support:<\/strong> Implement a system for users to add their own themes via configuration files in the <code>.config<\/code> directory.<\/li>\n <li><strong>Expanded Git Command Support:<\/strong> Integrate a wider range of Git commands to provide more comprehensive repository management capabilities.<\/li>\n <li><strong>Bug Fixes:<\/strong> Address any outstanding bugs to improve stability and reliability.<\/li>\n <li><strong>Command History and Logging:<\/strong> Allow the secondary panel to store all the git commands history and gitx logs.<\/li>\n <li><strong>Repository Initialization:<\/strong> Add a feature that allows users to initialize a new Git repository in the current directory if one doesn't already exist.<\/li>\n <li><strong>Safety Warnings:<\/strong> Implement a warning system to alert users when they are about to initialize a repository in a potentially problematic location.<\/li>\n <li><strong>Custom Keybindings:<\/strong> Update config.toml logic to allow users to remap keys (currently hardcoded in keys.go).<\/li>\n <\/ul>\n<\/div>\n<div class=\"roadmap-section active\">\n <h3>\ud83d\ude80 In Progress <span class=\"status-badge active\">Active<\/span><\/h3>\n <ul>\n <li><strong>Items will be moved here soon from the planned section<\/strong>\n <\/ul>\n<\/div>\n<div class=\"roadmap-section planned\">\n <h3>\ud83d\udccb Planned <span class=\"status-badge planned\">Upcoming<\/span><\/h3>\n <ul>\n <li><strong>Improved Visual Diff Viewer:<\/strong> Enhance the diff viewer to provide a more intuitive and detailed representation of changes.<\/li>\n <li><strong>Interactive Staging:<\/strong> Allow users to stage and unstage individual lines or hunks of code directly from the visual diff viewer.<\/li>\n <li><strong>Merge Conflict Resolver:<\/strong> Build a tool to help users resolve merge conflicts from within the TUI.<\/li>\n <\/ul>\n<\/div>\n<\/div>"},{"title":"Getting started with GIT","link":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/02_setup_git\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/02_setup_git\/","description":"<h2 id=\"1-installation\">1. Installation<a class=\"td-heading-self-link\" href=\"#1-installation\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>You only need to install Git once.<\/p>\n<ul>\n<li>\n<p><strong>Windows<\/strong>: Download from <a href=\"https:\/\/git-scm.com\">GIT<\/a> and install.<\/p>\n<\/li>\n<li>\n<p><strong>Mac<\/strong>:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">brew install git\n<\/span><\/span><\/code><\/pre><\/div><\/li>\n<li>\n<p><strong>Linux (Ubuntu\/Debian)<\/strong>:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">sudo apt update <span class=\"o\">&amp;&amp;<\/span> sudo apt install git\n<\/span><\/span><\/code><\/pre><\/div><ul>\n<li><strong>ArchLinux<\/strong><\/li>\n<\/ul>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">sudo pacman -Syu <span class=\"o\">&amp;&amp;<\/span> sudo pacman -S git\n<\/span><\/span><\/code><\/pre><\/div><\/li>\n<\/ul>\n<p>Check if it\u2019s installed:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">git --version\n<\/span><\/span><\/code><\/pre><\/div><hr>\n<h2 id=\"2-the-git-workflow-the-big-picture\">2. The Git Workflow (The Big Picture)<a class=\"td-heading-self-link\" href=\"#2-the-git-workflow-the-big-picture\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>Before typing anything, let\u2019s understand <strong>how Git thinks<\/strong>.<\/p>\n<p>Every project has:<\/p>\n<ol>\n<li>\n<p><strong>Working Directory<\/strong> \u2192 where you edit files.<\/p>"},{"title":"Keybinds","link":"https:\/\/gitxtui.github.io\/docs\/learn\/getting-started\/02_using_gitx\/02_key_binds\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/getting-started\/02_using_gitx\/02_key_binds\/","description":"<h2 id=\"overview\">Overview<a class=\"td-heading-self-link\" href=\"#overview\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>gitx is a keyboard-driven application with customizable keybindings. Every action in gitx can be remapped to your preferred key combination. This guide covers all available keybinds, how to customize them, and best practices for configuring your keyboard shortcuts.<\/p>\n<h2 id=\"configuration\">Configuration<a class=\"td-heading-self-link\" href=\"#configuration\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>Keybindings are configured in your gitx configuration file located at <code>~\/.config\/gitx\/config.toml<\/code>. The keybindings section uses the following format:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-toml\" data-lang=\"toml\"><span class=\"line\"><span class=\"cl\"><span class=\"p\">[<\/span><span class=\"nx\">keybindings<\/span><span class=\"p\">]<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"nx\">action_name<\/span> <span class=\"p\">=<\/span> <span class=\"s2\">&#34;key_combination&#34;<\/span>\n<\/span><\/span><\/code><\/pre><\/div><h3 id=\"key-specification-format\">Key Specification Format<a class=\"td-heading-self-link\" href=\"#key-specification-format\" aria-label=\"Heading self-link\"><\/a><\/h3>\n<p>Keys can be specified in several ways:<\/p>"},{"title":"Custom Themes","link":"https:\/\/gitxtui.github.io\/docs\/learn\/getting-started\/02_using_gitx\/03_theme\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/getting-started\/02_using_gitx\/03_theme\/","description":"<h2 id=\"overview\">Overview<a class=\"td-heading-self-link\" href=\"#overview\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>gitx comes with built-in themes and supports fully customizable user-defined themes. You can modify colors, styles, and the overall appearance of the interface. This guide covers using built-in themes and creating your own custom themes.<\/p>\n<h2 id=\"built-in-themes\">Built-in Themes<a class=\"td-heading-self-link\" href=\"#built-in-themes\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>gitx includes the following built-in themes:<\/p>\n<ul>\n<li><strong>GitHub Dark<\/strong> (default) - A clean dark theme based on GitHub&rsquo;s color palette<\/li>\n<li><strong>Gruvbox<\/strong> - A retro groove color scheme<\/li>\n<\/ul>\n<h3 id=\"using-built-in-themes\">Using Built-in Themes<a class=\"td-heading-self-link\" href=\"#using-built-in-themes\" aria-label=\"Heading self-link\"><\/a><\/h3>\n<p>To switch between built-in themes:<\/p>"},{"title":"The Three Stages in Git","link":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/03_stages_git\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/03_stages_git\/","description":"<h2 id=\"what-are-the-three-stages-in-git\">What Are the Three Stages in Git?<a class=\"td-heading-self-link\" href=\"#what-are-the-three-stages-in-git\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>Git tracks your changes in three main stages:<br>\n<strong>Working Directory<\/strong>, <strong>Staging Area (Index)<\/strong>, and <strong>Repository (Commit History)<\/strong>.<br>\nUnderstanding these stages is key to mastering Git\u2019s workflow!<\/p>\n<hr>\n<h2 id=\"1-working-directory\">1. Working Directory<a class=\"td-heading-self-link\" href=\"#1-working-directory\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ul>\n<li>This is your project folder on your computer.<\/li>\n<li>Any changes you make to files\u2014editing, adding, deleting\u2014happen here first.<\/li>\n<li>Files in the working directory can be:\n<ul>\n<li><strong>Untracked:<\/strong> New files Git hasn\u2019t seen before.<\/li>\n<li><strong>Modified:<\/strong> Files you\u2019ve changed since the last commit.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>Example:<\/strong><br>\nYou edit <code>main.py<\/code> and add a new file <code>README.md<\/code>.<br>\nBoth are in your working directory.<\/p>"},{"title":"Stashing Changes in Git","link":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/04_stashing\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/04_stashing\/","description":"<h2 id=\"what-is-stashing\">What is Stashing?<a class=\"td-heading-self-link\" href=\"#what-is-stashing\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p><strong>Stashing<\/strong> in Git lets you temporarily save changes in your working directory that you\u2019re not ready to commit.<br>\nIt\u2019s like putting your unfinished work in a &ldquo;drawer&rdquo; so you can switch branches, pull updates, or do other tasks\u2014then come back and finish later.<\/p>\n<hr>\n<h2 id=\"why-use-stash\">Why Use Stash?<a class=\"td-heading-self-link\" href=\"#why-use-stash\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ul>\n<li><strong>Switch branches safely:<\/strong><br>\nIf you have uncommitted changes but need to switch to another branch, stash lets you save your work without committing.<\/li>\n<li><strong>Keep your work-in-progress separate:<\/strong><br>\nAvoid cluttering your commit history with incomplete or experimental changes.<\/li>\n<li><strong>Handle emergencies:<\/strong><br>\nIf you need to quickly fix something elsewhere, stash your current work and come back to it later.<\/li>\n<\/ul>\n<hr>\n<h2 id=\"how-does-stash-work\">How Does Stash Work?<a class=\"td-heading-self-link\" href=\"#how-does-stash-work\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>When you run <code>git stash<\/code>, Git saves your changes (tracked files, and optionally untracked files) in a special stack.<br>\nYour working directory is then clean, as if you just checked out the branch.<\/p>"},{"title":"Working with Branches","link":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/01_branches_working\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/01_branches_working\/","description":"<h2 id=\"listing-branches\">Listing Branches<a class=\"td-heading-self-link\" href=\"#listing-branches\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>To see your <strong>local branches<\/strong>, use:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">git branch\n<\/span><\/span><\/code><\/pre><\/div><blockquote>\n<p><strong>Expected output:<\/strong><\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\">* main\n<\/span><\/span><\/code><\/pre><\/div><\/blockquote>\n<p><br><br><\/p>\n<p>To list <strong>all branches<\/strong> (including remote branches), use:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">git branch -a\n<\/span><\/span><\/code><\/pre><\/div><blockquote>\n<p><strong>Expected output:<\/strong><\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\">* main\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> remotes\/origin\/main\n<\/span><\/span><\/code><\/pre><\/div><\/blockquote>\n<p><br><br><\/p>\n<p>To list <strong>Remote branches<\/strong> (including remote branches), use:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">git branch -r\n<\/span><\/span><\/code><\/pre><\/div><blockquote>\n<p><strong>Expected output:<\/strong><\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\">* remotes\/origin\/main\n<\/span><\/span><\/code><\/pre><\/div><\/blockquote>\n<br>\n<hr>\n<ul>\n<li>The branch marked with an asterisk (<code>*<\/code>) is your <strong>currently active branch<\/strong>.<\/li>\n<li>Any changes or commits you make are added to this branch.<\/li>\n<\/ul>\n<hr>\n<blockquote>\n<p><strong>Tip:<\/strong><br>\nUse branches to keep your work organized and your main branch stable!<\/p>"},{"title":"Creating Branches","link":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/02_branches_create\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/02_branches_create\/","description":"<h2 id=\"creating-a-branch\">Creating a Branch<a class=\"td-heading-self-link\" href=\"#creating-a-branch\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<h4 id=\"command-1-create-only\">Command 1: Create only<a class=\"td-heading-self-link\" href=\"#command-1-create-only\" aria-label=\"Heading self-link\"><\/a><\/h4>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">git branch &lt;branch-name&gt;\n<\/span><\/span><\/code><\/pre><\/div><ul>\n<li>Creates a new branch.<\/li>\n<li>Does not switch to it.<\/li>\n<li>You\u2019re still on the same branch as before.<\/li>\n<\/ul>\n<h4 id=\"command-2-create--switch\">Command 2: Create + switch<a class=\"td-heading-self-link\" href=\"#command-2-create--switch\" aria-label=\"Heading self-link\"><\/a><\/h4>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">git checkout -b &lt;branch-name&gt;\n<\/span><\/span><\/code><\/pre><\/div><ul>\n<li>Shortcut: creates the branch and switches to it.<\/li>\n<li>Older syntax.<\/li>\n<\/ul>\n<h4 id=\"command-3-modern-way\">Command 3: Modern way<a class=\"td-heading-self-link\" href=\"#command-3-modern-way\" aria-label=\"Heading self-link\"><\/a><\/h4>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">git switch -c &lt;branch-name&gt;\n<\/span><\/span><\/code><\/pre><\/div><ul>\n<li>Recommended modern syntax.<\/li>\n<li>Does the same thing as checkout -b.<\/li>\n<\/ul>"},{"title":"Working with Remotes","link":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/remotes\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/remotes\/","description":"<p>Up until now, we have been working on our local system. Git, however, is built to facilitate collaboration among multiple developers. To let other developers work on our code, we need to publish this code to a website.<\/p>\n<hr>\n<h2 id=\"why-not-just-share-files\">Why Not Just Share Files?<a class=\"td-heading-self-link\" href=\"#why-not-just-share-files\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>You can upload your code anywhere\u2014zip it up and put it on cloud storage like Google Drive or Dropbox, or send the files as an attachment to your friend.<br>\nBut these methods <strong>won&rsquo;t preserve your commit history, branches, or collaboration features<\/strong> (unless you include the hidden <code>.git<\/code> folder, which is risky and not recommended).<\/p>"},{"title":"Best Practices for Using Git","link":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/05_bestpract\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/05_bestpract\/","description":"<p>Following best practices helps you avoid mistakes, keep your project history clean, and collaborate smoothly with others.<br>\nHere are essential tips for working with Git, whether you\u2019re solo or on a team!<\/p>\n<hr>\n<h2 id=\"1-commit-often-but-meaningfully\">1. Commit Often, But Meaningfully<a class=\"td-heading-self-link\" href=\"#1-commit-often-but-meaningfully\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ul>\n<li><strong>Make small, focused commits:<\/strong><br>\nEach commit should represent a single logical change.<\/li>\n<li><strong>Avoid huge commits:<\/strong><br>\nLarge commits are hard to review and revert.<\/li>\n<li><strong>Commit early and often:<\/strong><br>\nThis makes it easier to track changes and fix mistakes.<\/li>\n<\/ul>\n<hr>\n<h2 id=\"2-write-clear-commit-messages\">2. Write Clear Commit Messages<a class=\"td-heading-self-link\" href=\"#2-write-clear-commit-messages\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ul>\n<li><strong>Describe what and why:<\/strong><br>\nExplain what changed and why, not just \u201cfix\u201d or \u201cupdate\u201d.<\/li>\n<li><strong>Use the imperative mood:<\/strong><br>\nExample: \u201cAdd login feature\u201d instead of \u201cAdded login feature\u201d.<\/li>\n<li><strong>Reference issues or tickets:<\/strong><br>\nIf using issue tracking, include references (e.g., <code>Fixes #42<\/code>).<\/li>\n<\/ul>\n<hr>\n<h2 id=\"3-use-branches-for-features-and-fixes\">3. Use Branches for Features and Fixes<a class=\"td-heading-self-link\" href=\"#3-use-branches-for-features-and-fixes\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ul>\n<li><strong>Create a new branch for each feature or bugfix:<\/strong><br>\nKeeps work isolated and makes merging easier.<\/li>\n<li><strong>Name branches descriptively:<\/strong><br>\nExamples: <code>feature\/login<\/code>, <code>bugfix\/header<\/code>, <code>hotfix\/payment-crash<\/code>.<\/li>\n<\/ul>\n<hr>\n<h2 id=\"4-pull-and-merge-regularly\">4. Pull and Merge Regularly<a class=\"td-heading-self-link\" href=\"#4-pull-and-merge-regularly\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ul>\n<li><strong>Sync with the remote often:<\/strong><br>\nUse <code>git pull<\/code> to get the latest changes before starting new work.<\/li>\n<li><strong>Resolve conflicts early:<\/strong><br>\nThe longer you wait, the harder conflicts become to fix.<\/li>\n<\/ul>\n<hr>\n<h2 id=\"5-review-before-you-commit\">5. Review Before You Commit<a class=\"td-heading-self-link\" href=\"#5-review-before-you-commit\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ul>\n<li><strong>Check your changes:<\/strong><br>\nUse <code>git status<\/code> and <code>git diff<\/code> to review what you\u2019re about to commit.<\/li>\n<li><strong>Don\u2019t commit secrets or sensitive data:<\/strong><br>\nDouble-check for passwords, API keys, or private info.<\/li>\n<\/ul>\n<hr>\n<h2 id=\"6-clean-up-branches\">6. Clean Up Branches<a class=\"td-heading-self-link\" href=\"#6-clean-up-branches\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ul>\n<li><strong>Delete branches after merging:<\/strong><br>\nKeeps your repository tidy and avoids confusion.<\/li>\n<li><strong>Remove stale or unused branches regularly.<\/strong><\/li>\n<\/ul>\n<hr>\n<h2 id=\"7-use-gitignore\">7. Use .gitignore<a class=\"td-heading-self-link\" href=\"#7-use-gitignore\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ul>\n<li><strong>Ignore files that shouldn\u2019t be tracked:<\/strong><br>\nAdd build artifacts, logs, and environment files to <code>.gitignore<\/code>.<\/li>\n<li><strong>Keep <code>.gitignore<\/code> up to date<\/strong> as your project grows.<\/li>\n<\/ul>\n<hr>\n<h2 id=\"8-protect-important-branches\">8. Protect Important Branches<a class=\"td-heading-self-link\" href=\"#8-protect-important-branches\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ul>\n<li><strong>Enable branch protection rules:<\/strong><br>\nPrevent force-pushes, require pull requests, and enforce code reviews on critical branches like <code>main<\/code> or <code>master<\/code>.<\/li>\n<\/ul>\n<hr>\n<h2 id=\"9-test-before-you-push\">9. Test Before You Push<a class=\"td-heading-self-link\" href=\"#9-test-before-you-push\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ul>\n<li><strong>Run tests and build your code before pushing:<\/strong><br>\nAvoid breaking the shared codebase.<\/li>\n<\/ul>\n<hr>\n<h2 id=\"10-document-your-workflow\">10. Document Your Workflow<a class=\"td-heading-self-link\" href=\"#10-document-your-workflow\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ul>\n<li><strong>Write down your team\u2019s Git workflow:<\/strong><br>\nMake sure everyone knows how to branch, merge, and review code.<\/li>\n<li><strong>Update documentation as your process evolves.<\/strong><\/li>\n<\/ul>\n<hr>\n<h2 id=\"summary-table\">Summary Table<a class=\"td-heading-self-link\" href=\"#summary-table\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<table>\n <thead>\n <tr>\n <th>Practice<\/th>\n <th>Why It Matters<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td>Small, focused commits<\/td>\n <td>Easier to review, revert, and understand<\/td>\n <\/tr>\n <tr>\n <td>Clear commit messages<\/td>\n <td>Helps everyone know what changed and why<\/td>\n <\/tr>\n <tr>\n <td>Feature\/fix branches<\/td>\n <td>Isolate work, simplify collaboration<\/td>\n <\/tr>\n <tr>\n <td>Pull\/merge regularly<\/td>\n <td>Avoid big conflicts, stay up to date<\/td>\n <\/tr>\n <tr>\n <td>Review before commit<\/td>\n <td>Prevent mistakes, keep history clean<\/td>\n <\/tr>\n <tr>\n <td>Clean up branches<\/td>\n <td>Tidy repo, avoid confusion<\/td>\n <\/tr>\n <tr>\n <td>Use .gitignore<\/td>\n <td>Don\u2019t track unnecessary files<\/td>\n <\/tr>\n <tr>\n <td>Protect branches<\/td>\n <td>Keep important code safe<\/td>\n <\/tr>\n <tr>\n <td>Test before push<\/td>\n <td>Prevent breaking the build<\/td>\n <\/tr>\n <tr>\n <td>Document workflow<\/td>\n <td>Team clarity, fewer mistakes<\/td>\n <\/tr>\n <\/tbody>\n<\/table>\n<hr>\n<blockquote>\n<p><strong>Tip:<\/strong><br>\nGood Git habits save time, prevent headaches, and make you a better collaborator.<br>\nPractice these tips and share them with your team!<\/p>"},{"title":"Understanding HEAD","link":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/03_branches_head\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/03_branches_head\/","description":"<h2 id=\"what-is-head-in-git\">What is HEAD in Git?<a class=\"td-heading-self-link\" href=\"#what-is-head-in-git\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>When working with Git, you\u2019ll often hear about something called <strong>HEAD<\/strong>.<br>\nThink of <code>HEAD<\/code> as a special pointer that tells Git, \u201cThis is where you are right now.\u201d<\/p>\n<hr>\n<h2 id=\"head-your-current-position\">HEAD: Your Current Position<a class=\"td-heading-self-link\" href=\"#head-your-current-position\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ul>\n<li><strong>HEAD<\/strong> always points to your current branch.<\/li>\n<li>That branch, in turn, points to a specific commit (a snapshot of your project).<\/li>\n<\/ul>\n<p><strong>Visualization:<\/strong><\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\">HEAD\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> \u2193\n<\/span><\/span><span class=\"line\"><span class=\"cl\">branch (e.g. main)\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> \u2193\n<\/span><\/span><span class=\"line\"><span class=\"cl\">commit (e.g. a1b2c3d)\n<\/span><\/span><\/code><\/pre><\/div><ul>\n<li>When you make a new commit, the branch moves forward, and so does HEAD.<\/li>\n<\/ul>\n<hr>\n<h2 id=\"how-head-moves\">How HEAD Moves<a class=\"td-heading-self-link\" href=\"#how-head-moves\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ul>\n<li>If you switch branches, HEAD moves to point to the new branch.<\/li>\n<li>If you make a commit, HEAD (via the branch) points to the new commit.<\/li>\n<\/ul>\n<hr>\n<h2 id=\"detached-head-state\">Detached HEAD State<a class=\"td-heading-self-link\" href=\"#detached-head-state\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>Sometimes, HEAD doesn\u2019t point to a branch, but <strong>directly to a commit<\/strong>.<br>\nThis is called a <strong>detached HEAD<\/strong>.<\/p>"},{"title":"Merging Branches","link":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/04_branches_merging\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/04_branches_merging\/","description":"<h2 id=\"what-is-merging\">What is Merging?<a class=\"td-heading-self-link\" href=\"#what-is-merging\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p><strong>Merging<\/strong> in Git is the process of taking the changes from one branch and combining them into another branch.<br>\nThis is how you bring together work from different branches\u2014like adding a new feature you built on a separate branch back into your main project.<\/p>\n<hr>\n<h2 id=\"why-merge\">Why Merge?<a class=\"td-heading-self-link\" href=\"#why-merge\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ul>\n<li>You might have a <code>main<\/code> branch that holds your stable code.<\/li>\n<li>You create a <code>feature<\/code> branch to work on something new, so your main code isn\u2019t disturbed.<\/li>\n<li>When your feature is ready, you want to add it back to <code>main<\/code>\u2014<strong>without losing any work from either branch<\/strong>.<\/li>\n<li>Merging lets you combine the work from both branches, keeping all the commit history and changes.<\/li>\n<\/ul>\n<hr>\n<h2 id=\"how-does-merging-work\">How Does Merging Work?<a class=\"td-heading-self-link\" href=\"#how-does-merging-work\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>When you merge, Git tries to automatically combine the changes from both branches.<br>\nIf the changes don\u2019t overlap, Git merges them automatically.<br>\nIf the same lines were changed in both branches, you\u2019ll get a <strong>merge conflict<\/strong> (see the Conflicts topic).<\/p>"},{"title":"Handling Merge Conflicts","link":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/05_branches_conflicts\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/05_branches_conflicts\/","description":"<h2 id=\"what-is-a-merge-conflict\">What is a Merge Conflict?<a class=\"td-heading-self-link\" href=\"#what-is-a-merge-conflict\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>A <strong>merge conflict<\/strong> happens when Git cannot automatically combine changes from two branches.<br>\nThis usually occurs when two branches have changed the same part of a file, or when one branch deletes a file that the other branch has modified.<\/p>\n<hr>\n<h2 id=\"why-do-conflicts-happen\">Why Do Conflicts Happen?<a class=\"td-heading-self-link\" href=\"#why-do-conflicts-happen\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ul>\n<li>Two people (or two branches) edit the <strong>same line<\/strong> in a file differently.<\/li>\n<li>One branch deletes a file that the other branch edits.<\/li>\n<li>Changes are made to the same section of a file in both branches.<\/li>\n<\/ul>\n<p>Git tries to merge changes automatically, but if it\u2019s unsure which change to keep, it stops and asks you to decide.<\/p>"},{"title":"Deleting Branches","link":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/06_branches_deletion\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/06_branches_deletion\/","description":"<h2 id=\"why-delete-branches\">Why Delete Branches?<a class=\"td-heading-self-link\" href=\"#why-delete-branches\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>Branches are great for working on features, bug fixes, or experiments.<br>\nBut once a branch has served its purpose (for example, a feature is merged into <code>main<\/code>), it\u2019s a good idea to delete it.<br>\nThis keeps your repository clean and avoids confusion.<\/p>\n<hr>\n<h2 id=\"deleting-local-branches\">Deleting Local Branches<a class=\"td-heading-self-link\" href=\"#deleting-local-branches\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>A <strong>local branch<\/strong> exists only on your computer.<\/p>\n<h3 id=\"delete-a-local-branch-safe\">Delete a Local Branch (Safe)<a class=\"td-heading-self-link\" href=\"#delete-a-local-branch-safe\" aria-label=\"Heading self-link\"><\/a><\/h3>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">git branch -d &lt;branch-name&gt;\n<\/span><\/span><\/code><\/pre><\/div><ul>\n<li>Deletes the branch <strong>only if it has been fully merged<\/strong> into your current branch.<\/li>\n<li>Prevents you from accidentally deleting work that hasn\u2019t been saved elsewhere.<\/li>\n<\/ul>\n<p><strong>Example:<\/strong><\/p>"},{"title":"Understanding Remote Branches","link":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/07_branches_remote\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/07_branches_remote\/","description":"<h2 id=\"what-is-a-remote-branch\">What is a Remote Branch?<a class=\"td-heading-self-link\" href=\"#what-is-a-remote-branch\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>A <strong>remote branch<\/strong> is a branch that exists on a remote repository (like GitHub, GitLab, or Bitbucket), not just on your local computer.<br>\nRemote branches let you collaborate with others by sharing your work and keeping your local repository in sync with the remote server.<\/p>\n<hr>\n<h2 id=\"how-do-remote-branches-work\">How Do Remote Branches Work?<a class=\"td-heading-self-link\" href=\"#how-do-remote-branches-work\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ul>\n<li>When you <strong>clone<\/strong> a repository, Git creates local copies of all the remote branches.<\/li>\n<li>Remote branches are read-only references to the state of branches on the remote server.<\/li>\n<li>They are named like <code>origin\/main<\/code>, <code>origin\/feature\/login<\/code>, etc.\n<ul>\n<li><code>origin<\/code> is the default name for the remote you cloned from.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr>\n<h2 id=\"common-remote-branch-commands\">Common Remote Branch Commands<a class=\"td-heading-self-link\" href=\"#common-remote-branch-commands\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<h3 id=\"1-listing-remote-branches\">1. Listing Remote Branches<a class=\"td-heading-self-link\" href=\"#1-listing-remote-branches\" aria-label=\"Heading self-link\"><\/a><\/h3>\n<ul>\n<li>\n<p><strong>List only remote branches:<\/strong><\/p>"},{"title":"Understanding Upstream Branches","link":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/08_branches_upstream\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/08_branches_upstream\/","description":"<h2 id=\"what-is-an-upstream-branch\">What is an Upstream Branch?<a class=\"td-heading-self-link\" href=\"#what-is-an-upstream-branch\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>An <strong>upstream branch<\/strong> in Git is the remote branch that your local branch is &ldquo;tracking.&rdquo;<br>\nThis means your local branch knows which remote branch it should compare itself to when you run commands like <code>git pull<\/code> or <code>git push<\/code>\u2014so you don\u2019t have to specify the remote branch every time.<\/p>\n<hr>\n<h2 id=\"why-use-upstream-branches\">Why Use Upstream Branches?<a class=\"td-heading-self-link\" href=\"#why-use-upstream-branches\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ul>\n<li><strong>Convenience:<\/strong><br>\nYou can simply run <code>git pull<\/code> or <code>git push<\/code> without extra arguments, and Git knows which remote branch to use.<\/li>\n<li><strong>Collaboration:<\/strong><br>\nKeeps your local branch in sync with the team\u2019s shared branch on the remote server.<\/li>\n<li><strong>Safety:<\/strong><br>\nHelps prevent mistakes, like pushing to the wrong branch.<\/li>\n<\/ul>\n<hr>\n<h2 id=\"how-do-you-set-an-upstream-branch\">How Do You Set an Upstream Branch?<a class=\"td-heading-self-link\" href=\"#how-do-you-set-an-upstream-branch\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<h3 id=\"when-creating-a-local-branch-from-a-remote-branch\">When Creating a Local Branch from a Remote Branch<a class=\"td-heading-self-link\" href=\"#when-creating-a-local-branch-from-a-remote-branch\" aria-label=\"Heading self-link\"><\/a><\/h3>\n<p>If you create a local branch from a remote branch, Git usually sets the upstream automatically:<\/p>"},{"title":"Renaming Branches","link":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/09_branches_rename\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/09_branches_rename\/","description":"<h2 id=\"why-rename-a-branch\">Why Rename a Branch?<a class=\"td-heading-self-link\" href=\"#why-rename-a-branch\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>Sometimes you create a branch with a quick name, but later want something more descriptive or consistent.<br>\nRenaming branches helps keep your repository organized and clear for everyone working on it.<\/p>\n<hr>\n<h2 id=\"renaming-a-local-branch\">Renaming a Local Branch<a class=\"td-heading-self-link\" href=\"#renaming-a-local-branch\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<h3 id=\"rename-the-current-branch\">Rename the Current Branch<a class=\"td-heading-self-link\" href=\"#rename-the-current-branch\" aria-label=\"Heading self-link\"><\/a><\/h3>\n<p>If you are <strong>on the branch you want to rename<\/strong>:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">git branch -m new-branch-name\n<\/span><\/span><\/code><\/pre><\/div><ul>\n<li><code>-m<\/code> stands for &ldquo;move&rdquo; (rename).<\/li>\n<li>This changes the branch name in your local repository.<\/li>\n<\/ul>\n<p><strong>Example:<\/strong><\/p>"},{"title":"Interactive Rebase in Git","link":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/10_branches_rebasing\/01_branches_rebasing_interactive\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/10_branches_rebasing\/01_branches_rebasing_interactive\/","description":"<h2 id=\"what-is-interactive-rebase\">What is Interactive Rebase?<a class=\"td-heading-self-link\" href=\"#what-is-interactive-rebase\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p><strong>Interactive rebase<\/strong> is a powerful Git feature that lets you rewrite, edit, reorder, squash, or even delete commits in your branch\u2019s history.<br>\nIt\u2019s called &ldquo;interactive&rdquo; because Git opens an editor and lets you choose exactly what happens to each commit.<\/p>\n<hr>\n<h2 id=\"why-use-interactive-rebase\">Why Use Interactive Rebase?<a class=\"td-heading-self-link\" href=\"#why-use-interactive-rebase\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ul>\n<li><strong>Clean up messy commit history<\/strong> before sharing your work.<\/li>\n<li><strong>Combine (squash) multiple commits<\/strong> into one.<\/li>\n<li><strong>Edit commit messages<\/strong> for clarity or consistency.<\/li>\n<li><strong>Reorder commits<\/strong> to make history logical.<\/li>\n<li><strong>Remove unwanted commits<\/strong> (like mistakes or debug code).<\/li>\n<li><strong>Split a commit<\/strong> into smaller, more focused commits.<\/li>\n<\/ul>\n<hr>\n<h2 id=\"how-to-start-an-interactive-rebase\">How to Start an Interactive Rebase<a class=\"td-heading-self-link\" href=\"#how-to-start-an-interactive-rebase\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>Decide how many commits you want to work with (counting backwards from your current commit):<\/p>"},{"title":"Squash Commits with Interactive Rebase","link":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/10_branches_rebasing\/02_branches_rebasing_squash\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/10_branches_rebasing\/02_branches_rebasing_squash\/","description":"<h2 id=\"what-is-squashing\">What is Squashing?<a class=\"td-heading-self-link\" href=\"#what-is-squashing\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p><strong>Squashing<\/strong> means combining multiple commits into a single commit.<br>\nThis is useful for cleaning up your commit history before merging a feature branch\u2014so instead of a long list of tiny or &ldquo;work in progress&rdquo; commits, you have one clear, meaningful commit.<\/p>\n<hr>\n<h2 id=\"why-squash-commits\">Why Squash Commits?<a class=\"td-heading-self-link\" href=\"#why-squash-commits\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ul>\n<li><strong>Cleaner History:<\/strong><br>\nMakes your project history easier to read and understand.<\/li>\n<li><strong>Atomic Changes:<\/strong><br>\nGroups related changes together, making it easier to review and revert if needed.<\/li>\n<li><strong>Professionalism:<\/strong><br>\nShows a tidy, intentional history when collaborating or submitting pull requests.<\/li>\n<\/ul>\n<hr>\n<h2 id=\"how-to-squash-commits-using-interactive-rebase\">How to Squash Commits Using Interactive Rebase<a class=\"td-heading-self-link\" href=\"#how-to-squash-commits-using-interactive-rebase\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>Suppose your branch has several commits you want to squash into one.<\/p>"},{"title":"Reordering Commits with Interactive Rebase","link":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/10_branches_rebasing\/03_branches_rebasing_reorder\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/10_branches_rebasing\/03_branches_rebasing_reorder\/","description":"<h2 id=\"why-reorder-commits\">Why Reorder Commits?<a class=\"td-heading-self-link\" href=\"#why-reorder-commits\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>Sometimes, you make commits in an order that doesn\u2019t make sense for the project\u2019s history.<br>\nMaybe you fixed a typo before adding the main feature, or you want related changes grouped together.<br>\n<strong>Reordering commits<\/strong> helps you organize your history so it\u2019s logical, readable, and easy to review.<\/p>\n<hr>\n<h2 id=\"how-to-reorder-commits-in-git\">How to Reorder Commits in Git<a class=\"td-heading-self-link\" href=\"#how-to-reorder-commits-in-git\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>You use <strong>interactive rebase<\/strong> to reorder commits.<br>\nThis lets you pick up any commit and move it before or after others.<\/p>"},{"title":"Reordering Commits","link":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/11_branches_cherry\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/11_branches_cherry\/","description":"<h2 id=\"why-reorder-commits\">Why Reorder Commits?<a class=\"td-heading-self-link\" href=\"#why-reorder-commits\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>Sometimes, you make commits in an order that doesn\u2019t make sense for the project\u2019s history.<br>\nMaybe you fixed a typo before adding the main feature, or you want related changes grouped together.<br>\n<strong>Reordering commits<\/strong> helps you organize your history so it\u2019s logical, readable, and easy to review.<\/p>\n<hr>\n<h2 id=\"how-to-reorder-commits-in-git\">How to Reorder Commits in Git<a class=\"td-heading-self-link\" href=\"#how-to-reorder-commits-in-git\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>You use <strong>interactive rebase<\/strong> to reorder commits.<br>\nThis lets you pick up any commit and move it before or after others.<\/p>"},{"title":"Branching Workflows","link":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/12_branches_workflows\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/12_branches_workflows\/","description":"<h2 id=\"what-is-a-branching-workflow\">What is a Branching Workflow?<a class=\"td-heading-self-link\" href=\"#what-is-a-branching-workflow\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>A <strong>branching workflow<\/strong> is a strategy for how you and your team use branches to organize work in a Git repository.<br>\nIt defines how features, fixes, releases, and collaboration happen\u2014making teamwork smoother and your project history clearer.<\/p>\n<hr>\n<h2 id=\"why-use-a-workflow\">Why Use a Workflow?<a class=\"td-heading-self-link\" href=\"#why-use-a-workflow\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ul>\n<li><strong>Organization:<\/strong><br>\nKeeps features, fixes, and releases separate.<\/li>\n<li><strong>Collaboration:<\/strong><br>\nAllows multiple people to work independently.<\/li>\n<li><strong>Safety:<\/strong><br>\nProtects stable code from unfinished or experimental changes.<\/li>\n<li><strong>Traceability:<\/strong><br>\nMakes it easy to see what was done, when, and by whom.<\/li>\n<\/ul>\n<hr>\n<h2 id=\"common-branching-workflows\">Common Branching Workflows<a class=\"td-heading-self-link\" href=\"#common-branching-workflows\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<h3 id=\"1-feature-branch-workflow\">1. Feature Branch Workflow<a class=\"td-heading-self-link\" href=\"#1-feature-branch-workflow\" aria-label=\"Heading self-link\"><\/a><\/h3>\n<ul>\n<li><strong>Each new feature or fix gets its own branch.<\/strong><\/li>\n<li>Branches are created from the main branch (often called <code>main<\/code> or <code>master<\/code>).<\/li>\n<li>When finished, the feature branch is merged back into <code>main<\/code>.<\/li>\n<\/ul>\n<p><strong>Example:<\/strong><\/p>"},{"title":"Branch Protection","link":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/13_branches_protection\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/13_branches_protection\/","description":"<h2 id=\"what-is-branch-protection\">What is Branch Protection?<a class=\"td-heading-self-link\" href=\"#what-is-branch-protection\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p><strong>Branch protection<\/strong> is a set of rules that prevent unwanted changes to important branches in your repository\u2014like <code>main<\/code>, <code>master<\/code>, or <code>develop<\/code>.<br>\nIt\u2019s a safety feature, usually managed on platforms like GitHub, GitLab, or Bitbucket, to keep your codebase stable and secure.<\/p>\n<hr>\n<h2 id=\"why-use-branch-protection\">Why Use Branch Protection?<a class=\"td-heading-self-link\" href=\"#why-use-branch-protection\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ul>\n<li><strong>Prevent mistakes:<\/strong><br>\nStops accidental force-pushes, deletions, or direct commits to critical branches.<\/li>\n<li><strong>Enforce code review:<\/strong><br>\nRequire pull requests and approvals before merging changes.<\/li>\n<li><strong>Maintain stability:<\/strong><br>\nEnsure only tested, reviewed code reaches production branches.<\/li>\n<li><strong>Automate checks:<\/strong><br>\nRequire passing tests, successful builds, or other checks before merging.<\/li>\n<\/ul>\n<hr>\n<h2 id=\"common-branch-protection-rules\">Common Branch Protection Rules<a class=\"td-heading-self-link\" href=\"#common-branch-protection-rules\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<h3 id=\"1-require-pull-requests\">1. Require Pull Requests<a class=\"td-heading-self-link\" href=\"#1-require-pull-requests\" aria-label=\"Heading self-link\"><\/a><\/h3>\n<ul>\n<li>Disallow direct pushes to protected branches.<\/li>\n<li>All changes must go through a pull request (PR) for review.<\/li>\n<\/ul>\n<h3 id=\"2-require-reviews-and-approvals\">2. Require Reviews and Approvals<a class=\"td-heading-self-link\" href=\"#2-require-reviews-and-approvals\" aria-label=\"Heading self-link\"><\/a><\/h3>\n<ul>\n<li>Specify that one or more team members must approve a PR before it can be merged.<\/li>\n<\/ul>\n<h3 id=\"3-require-status-checks\">3. Require Status Checks<a class=\"td-heading-self-link\" href=\"#3-require-status-checks\" aria-label=\"Heading self-link\"><\/a><\/h3>\n<ul>\n<li>Only allow merging if automated tests, builds, or other checks pass.<\/li>\n<\/ul>\n<h3 id=\"4-restrict-who-can-push\">4. Restrict Who Can Push<a class=\"td-heading-self-link\" href=\"#4-restrict-who-can-push\" aria-label=\"Heading self-link\"><\/a><\/h3>\n<ul>\n<li>Limit who can push, merge, or delete the branch (e.g., only admins or maintainers).<\/li>\n<\/ul>\n<h3 id=\"5-prevent-force-pushes-and-deletion\">5. Prevent Force-Pushes and Deletion<a class=\"td-heading-self-link\" href=\"#5-prevent-force-pushes-and-deletion\" aria-label=\"Heading self-link\"><\/a><\/h3>\n<ul>\n<li>Block force-pushes (<code>git push --force<\/code>) to avoid rewriting history.<\/li>\n<li>Prevent accidental or malicious branch deletion.<\/li>\n<\/ul>\n<hr>\n<h2 id=\"how-to-set-up-branch-protection\">How to Set Up Branch Protection<a class=\"td-heading-self-link\" href=\"#how-to-set-up-branch-protection\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<h3 id=\"on-github\">On GitHub<a class=\"td-heading-self-link\" href=\"#on-github\" aria-label=\"Heading self-link\"><\/a><\/h3>\n<ol>\n<li>Go to your repository on GitHub.<\/li>\n<li>Click <strong>Settings<\/strong> &gt; <strong>Branches<\/strong>.<\/li>\n<li>Add a branch protection rule for your chosen branch (e.g., <code>main<\/code>).<\/li>\n<li>Select the rules you want (require PRs, reviews, status checks, etc.).<\/li>\n<li>Save the rule.<\/li>\n<\/ol>\n<h3 id=\"on-gitlab\">On GitLab<a class=\"td-heading-self-link\" href=\"#on-gitlab\" aria-label=\"Heading self-link\"><\/a><\/h3>\n<ol>\n<li>Go to your repository.<\/li>\n<li>Click <strong>Settings<\/strong> &gt; <strong>Repository<\/strong> &gt; <strong>Protected Branches<\/strong>.<\/li>\n<li>Choose the branch and set permissions for who can push, merge, or delete.<\/li>\n<\/ol>\n<h3 id=\"on-bitbucket\">On Bitbucket<a class=\"td-heading-self-link\" href=\"#on-bitbucket\" aria-label=\"Heading self-link\"><\/a><\/h3>\n<ol>\n<li>Go to your repository.<\/li>\n<li>Click <strong>Repository Settings<\/strong> &gt; <strong>Branch permissions<\/strong>.<\/li>\n<li>Add rules for your branches.<\/li>\n<\/ol>\n<hr>\n<h2 id=\"example-github-branch-protection\">Example: GitHub Branch Protection<a class=\"td-heading-self-link\" href=\"#example-github-branch-protection\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ul>\n<li>Require pull request before merging.<\/li>\n<li>Require at least one approval.<\/li>\n<li>Require status checks to pass.<\/li>\n<li>Restrict who can push.<\/li>\n<li>Block force-pushes and deletion.<\/li>\n<\/ul>\n<hr>\n<h2 id=\"when-to-protect-a-branch\">When to Protect a Branch<a class=\"td-heading-self-link\" href=\"#when-to-protect-a-branch\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ul>\n<li><strong>Production branches:<\/strong><br>\nAlways protect <code>main<\/code>, <code>master<\/code>, or any branch deployed to users.<\/li>\n<li><strong>Release branches:<\/strong><br>\nProtect branches used for releases or hotfixes.<\/li>\n<li><strong>Develop\/integration branches:<\/strong><br>\nProtect if multiple people merge features into them.<\/li>\n<\/ul>\n<hr>\n<h2 id=\"tips-for-branch-protection\">Tips for Branch Protection<a class=\"td-heading-self-link\" href=\"#tips-for-branch-protection\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ul>\n<li><strong>Document your rules:<\/strong><br>\nMake sure everyone on your team knows which branches are protected and why.<\/li>\n<li><strong>Review regularly:<\/strong><br>\nUpdate protection rules as your team or workflow changes.<\/li>\n<li><strong>Combine with workflows:<\/strong><br>\nUse protection rules alongside branching workflows for maximum safety.<\/li>\n<\/ul>\n<blockquote>\n<p><strong>Tip:<\/strong><br>\nSet it up early\u2014don\u2019t wait for a mistake to happen!<\/p>"},{"title":"Bonus Concepts","link":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/14_branches_bonus\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/branches\/14_branches_bonus\/","description":"<p>This section covers advanced and useful Git concepts related to branching, history, and project management.<br>\nEven if you\u2019re new to Git, these tools and ideas will help you understand and recover your project in tricky situations!<\/p>\n<hr>\n<h2 id=\"tags-vs-branches\">Tags vs Branches<a class=\"td-heading-self-link\" href=\"#tags-vs-branches\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<h3 id=\"what-is-a-tag\">What is a Tag?<a class=\"td-heading-self-link\" href=\"#what-is-a-tag\" aria-label=\"Heading self-link\"><\/a><\/h3>\n<ul>\n<li>A <strong>tag<\/strong> is a fixed pointer to a specific commit.<\/li>\n<li>Used to mark important points in history, like releases (<code>v1.0.0<\/code>, <code>v2.1.3<\/code>).<\/li>\n<li>Tags do <strong>not<\/strong> move\u2014they always point to the same commit.<\/li>\n<\/ul>\n<p><strong>Create a tag:<\/strong><\/p>"},{"title":"How to Contribute a Blog Post to gitx Documentation","link":"https:\/\/gitxtui.github.io\/docs\/blog\/2025\/10\/02\/how-to-contribute-a-blog-post-to-gitx-documentation\/","pubDate":"Thu, 02 Oct 2025 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/blog\/2025\/10\/02\/how-to-contribute-a-blog-post-to-gitx-documentation\/","description":"<p>Welcome to the gitx blog! We&rsquo;re excited to have you here and even more excited if you&rsquo;re thinking about contributing your own post. This guide will walk you through the entire process of creating and submitting a blog post to our documentation site.<\/p>\n<h2 id=\"what-should-you-write-about\">What Should You Write About?<a class=\"td-heading-self-link\" href=\"#what-should-you-write-about\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>We welcome blog posts on any topic related to Git! Here are some ideas to get you started:<\/p>\n<ul>\n<li><strong>Git Commands Deep Dive<\/strong>: Explain a specific Git command in detail (like <code>git bisect<\/code>, <code>git rebase<\/code>, or <code>git cherry-pick<\/code>)<\/li>\n<li><strong>Git Workflows<\/strong>: Share best practices for team collaboration using Git<\/li>\n<li><strong>Git History &amp; Fun Facts<\/strong>: Interesting trivia about Git&rsquo;s development or its creator<\/li>\n<li><strong>Personal Stories<\/strong>: How Git helped you solve a problem or improved your workflow<\/li>\n<li><strong>Tips &amp; Tricks<\/strong>: Lesser-known Git features that make developers more productive<\/li>\n<li><strong>Tutorials<\/strong>: Step-by-step guides for achieving specific tasks with Git<\/li>\n<\/ul>\n<h2 id=\"step-by-step-how-to-contribute\">Step-by-Step: How to Contribute<a class=\"td-heading-self-link\" href=\"#step-by-step-how-to-contribute\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<h3 id=\"1-fork-the-repository\">1. Fork the Repository<a class=\"td-heading-self-link\" href=\"#1-fork-the-repository\" aria-label=\"Heading self-link\"><\/a><\/h3>\n<p>Start by forking the <a href=\"https:\/\/github.com\/gitxtui\/docs\"><code>gitxtui\/docs<\/code><\/a> repository on GitHub. Click the &ldquo;Fork&rdquo; button in the top-right corner of the repository page.<\/p>"},{"title":"Intro to github actions","link":"https:\/\/gitxtui.github.io\/docs\/blog\/2025\/10\/02\/intro-to-github-actions\/","pubDate":"Thu, 02 Oct 2025 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/blog\/2025\/10\/02\/intro-to-github-actions\/","description":"<h1 id=\"the-problem\">The problem<a class=\"td-heading-self-link\" href=\"#the-problem\" aria-label=\"Heading self-link\"><\/a><\/h1>\n<p>Have you ever thought about how big tech companies manage to push code into production so seamlessly? How do they make sure thousands of test cases run automatically, catch issues before they break things, and still ship updates quickly? It almost feels like magic\u2014code goes in, and polished features come out the other side without chaos.<\/p>\n<h1 id=\"the-solution\">The Solution<a class=\"td-heading-self-link\" href=\"#the-solution\" aria-label=\"Heading self-link\"><\/a><\/h1>\n<p>The secret isn\u2019t magic at all\u2014it\u2019s automation. In this blog post, we\u2019ll explore how GitHub Actions, developer workflows, and CI\/CD pipelines work together to handle testing, automatic deployments, and smooth releases. By the end, you\u2019ll see how these tools make modern software development faster, safer, and much less stressful.<\/p>"},{"title":"Git Commands That Will Actually Save Your Day","link":"https:\/\/gitxtui.github.io\/docs\/blog\/2025\/10\/02\/git-commands-that-will-actually-save-your-day\/","pubDate":"Thu, 02 Oct 2025 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/blog\/2025\/10\/02\/git-commands-that-will-actually-save-your-day\/","description":"<p>Look, we all know <code>git commit<\/code>, <code>git push<\/code>, and <code>git pull<\/code>. But Git has a treasure trove of commands that can save you hours of frustration\u2014if only you knew they existed. Here are the genuinely useful ones that deserve way more attention.<\/p>\n<h2 id=\"git-reflog--your-time-machine-when-things-go-wrong\"><code>git reflog<\/code> \u2014 Your Time Machine When Things Go Wrong<a class=\"td-heading-self-link\" href=\"#git-reflog--your-time-machine-when-things-go-wrong\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<p>Ever executed <code>git reset --hard<\/code> and immediately regretted it? Or accidentally deleted a branch you needed? <strong>This is your safety net.<\/strong><\/p>"},{"title":"How I Resolve Merge Conflicts Easily","link":"https:\/\/gitxtui.github.io\/docs\/blog\/2025\/10\/02\/how-i-resolve-merge-conflicts-easily\/","pubDate":"Thu, 02 Oct 2025 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/blog\/2025\/10\/02\/how-i-resolve-merge-conflicts-easily\/","description":"<h1 id=\"how-i-resolve-merge-conflicts-easily\">How I Resolve Merge Conflicts Easily<a class=\"td-heading-self-link\" href=\"#how-i-resolve-merge-conflicts-easily\" aria-label=\"Heading self-link\"><\/a><\/h1>\n<p>Merge conflicts happen when Git can\u2019t automatically combine changes from different people. It\u2019s not scary \u2014 it just means Git needs you to decide which changes to keep.<\/p>\n<hr>\n<h2 id=\"steps-i-follow-to-resolve-conflicts\">Steps I Follow to Resolve Conflicts<a class=\"td-heading-self-link\" href=\"#steps-i-follow-to-resolve-conflicts\" aria-label=\"Heading self-link\"><\/a><\/h2>\n<ol>\n<li>\n<p><strong>Check the conflicted files<\/strong><br>\nGit will tell you which files have conflicts after a merge or pull.<\/p>\n<\/li>\n<li>\n<p><strong>Open the files and look for conflict markers<\/strong><br>\nYou\u2019ll see things like <code>&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD<\/code>, <code>=======<\/code>, and <code>&gt;&gt;&gt;&gt;&gt;&gt;&gt; branch-name<\/code>.<\/p>"},{"title":{},"link":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/git-guide\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/learn\/tutorials\/git-guide\/","description":{}},{"title":"Search Results","link":"https:\/\/gitxtui.github.io\/docs\/search\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/gitxtui.github.io\/docs\/search\/","description":{}}]}}