Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      How To Prevent WordPress SQL Injection Attacks

      June 13, 2025

      Error’d: Squaring the Circle

      June 13, 2025

      Java never goes out of style: Celebrating 30 years of the language

      June 12, 2025

      OpenAI o3-pro available in the API, BrowserStack adds Playwright support for real iOS devices, and more – Daily News Digest

      June 12, 2025

      Apple quietly makes running Linux containers easier on Macs

      June 13, 2025

      The 5 weirdest wellness gadgets I can’t live without (and why they make such a big difference)

      June 13, 2025

      I put my Bose QuietComfort Ultra away within hours of testing these headphones

      June 13, 2025

      I changed 8 settings on my Motorola phone to significantly improve the battery life

      June 13, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      QAQ-QQ-AI-QUEST

      June 13, 2025
      Recent

      QAQ-QQ-AI-QUEST

      June 13, 2025

      JS Dark Arts: Abusing prototypes and the Result type

      June 13, 2025

      Helpful Git Aliases To Maximize Developer Productivity

      June 13, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Linux Candy: WSelector – wallpaper selector manager

      June 13, 2025
      Recent

      Linux Candy: WSelector – wallpaper selector manager

      June 13, 2025

      LaZagne – credentials recovery project

      June 13, 2025

      Surface Pro 11 with Snapdragon X Elite drops to lowest price ever

      June 12, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Helpful Git Aliases To Maximize Developer Productivity

    Helpful Git Aliases To Maximize Developer Productivity

    June 13, 2025
    Git is a powerful tool, but it can sometimes be overwhelming with the number of commands required to perform common tasks. If you’ve ever found yourself typing out long, complex Git commands and wondered if there’s a faster way to get things done, you’re not alone. One way to streamline your workflow and reduce repetitive typing is by using Git aliases. These are shorthand commands that allow you to perform lengthy Git operations with just a few characters.
     
    In this post, we’ll explore some useful Git aliases that can help you maximize your productivity, speed up common workflows, and maintain a clean Git history.

    How To Add Aliases To Your Git Config File

    To start using Git aliases, you need to add them to your .gitconfig file. This file is typically located in your home directory, and it contains various configurations for your Git setup, including user details and aliases.
     
    Here’s how to add aliases:
      1. Open the .gitconfig file:
        • On Linux/MacOS, the .gitconfig file is typically located in your home directory (~/.gitconfig).
        • On Windows, it is located at C:Users<YourUsername>.gitconfig.
      2. Edit the .gitconfig file: You can manually add aliases to the [alias] section. If this section doesn’t already exist, simply add it at the top or bottom of the file. Below is an example of how your .gitconfig file should look once you add the aliases that we will cover in this post:
        [alias]
          # --- Branching ---
          co = checkout
          cob = checkout -b
          br = branch
        
          # --- Working Directory Status ---
          st = status
          df = diff
        
          # --- Commit & Push ---
          amod = "!f() { git add -u && git commit -m "$1" && git push; }; f"
          acp = "!f() { git add -A && git commit -m "$1" && git push; }; f"
        
          # --- Stash ---
          ss = stash
          ssd = stash drop
        
          # --- Reset / Cleanup ---
          nuke = reset --hard
          resetremote = !git reset --hard origin/main
        
          # --- Rebase Helpers ---
          rbc = rebase --continue
          rba = rebase --abort
          rbi = rebase -i
        
          # --- Log / History ---
          hist = log --oneline --graph --decorate --all
          ln = log --name-status
        
          # --- Fetch & Sync ---
          fetch = fetch --all --prune
          pullr = pull --rebase
          up = !git fetch --prune && git rebase origin/$(git rev-parse --abbrev-ref HEAD)
          cp = cherry-pick
      3. Save and close the file: Once you’ve added your aliases, save the file, and your new aliases will be available the next time you run Git commands in your terminal.
      4. Test the aliases: After saving your .gitconfig file, you can use your new aliases immediately. For example, try using git co to switch branches or git amod "your commit message" to commit your changes.

    Explanation of the Aliases

    I find these to be very helpful in my day-to-day work as a web developer. Here are some explanations of the aliases that I have added:

    Branching

    co = checkout

    When switching between branches, this alias saves you from typing git checkout <branch_name>. With co, switching is as simple as:
    git co <branch_name>
     

    cob = checkout -b

    Creating and switching to a new branch is easier with this alias. Instead of git checkout -b <new_branch_name>, simply use: 
    git cob <new_branch_name>
     

    br = branch

    If you need to quickly list all branches, whether local or remote, this alias is a fast way to do so:
    git br
     

    Working Directory Status

    st = status

    One of the most frequently used commands in Git, git status shows the current state of your working directory. By aliasing it as st, you save time while checking what’s been staged or modified:
    git st
     

    df = diff

    If you want to view the changes you’ve made compared to the last commit, use df for a quick comparison:
    git df
     

    Commit and Push

    amod = “!f() { git add -u && git commit -m ”$1” && git push; }; f”

    For quick commits, this alias allows you to add modified and deleted files (but not new untracked files), commit, and push all in one command! It’s perfect for when you want to keep things simple and focus on committing changes:
    git amod "Your commit message"
     

    acp = “!f() { git add -A && git commit -m ”$1” && git push; }; f”

    Similar to amod, but this version adds all changes, including untracked files, commits them, and pushes to the remote. It’s ideal when you’re working with a full set of changes:
    git acp "Your commit message"
     

    Stash

    ss = stash

    When you’re in the middle of something but need to quickly save your uncommitted changes to come back to later, git stash comes to the rescue. With this alias, you can stash your changes with ease:
    git ss
     

    ssd = stash drop

    Sometimes, after stashing, you may want to drop the stashed changes. With ssd, you can easily discard a stash:
    git ssd
     

    Reset / Cleanup

    nuke = reset –hard

    This alias will discard all local changes and reset your working directory to the last commit. It’s especially helpful when you want to start fresh or undo your recent changes:
    git nuke
     

    resetremote = !git reset –hard origin/main

    When your local branch has diverged from the remote and you want to match it exactly, this alias will discard local changes and reset to the remote branch. It’s a lifesaver when you need to restore your local branch to match the remote:
    git resetremote
     

    Rebase Helpers

    rbc = rebase –continue

    If you’re in the middle of a rebase and have resolved any conflicts, git rebase --continue lets you proceed. The rbc alias lets you continue the rebase without typing the full command: 
    git rbc
     

    rba = rebase –abort

    If something goes wrong during a rebase and you want to abandon the process, git rebase --abort will undo all changes from the rebase. This alias makes it quick and easy to abort a rebase:
    git rba
     

    rbi = rebase -i

    For an interactive rebase, where you can squash or reorder commits, git rebase -i is an essential command. The rbi alias will save you from typing the whole command:
    git rbi
     

    Log / History

    hist = log –oneline –graph –decorate –all

    For a good-looking, concise view of your commit history, this alias combines the best of git log. It shows commits in a graph format, with decoration to show branch names and tags, all while keeping the output short:
    git hist
     

    ln = log –name-status

    When you need to see what files were changed in each commit (with their status: added, modified, deleted), git log --name-status is invaluable. The ln alias helps you inspect commit changes more easily:
    git ln
     

    Fetch and Sync

    fetch = fetch –all –prune

    Fetching updates from all remotes and cleaning up any deleted branches with git fetch --all --prune is essential for keeping your remotes organized. The fetch alias makes this task a single command:
    git fetch
     

    pullr = pull –rebase

    When removing changes from the remote, rebase are often better than merges. This keeps your history linear and avoids unnecessary merge commits. The pullr alias performs a pull with a rebase:
    git pullr

    up = !git fetch –prune && git rebase origin/$(git rev-parse –abbrev-ref HEAD)

    This alias is a great shortcut if you want to quickly rebase your current branch onto its remote counterpart. It first fetches the latest updates from the remote and prunes any deleted remote-tracking branches, ensuring your local references are clean and up to date. Then it rebases your branch onto the corresponding remote, keeping your history in sync:
    git up
     

    cp = cherry-pick

    Cherry-picking allows you to apply a specific commit from another branch to your current branch. This alias makes it easier to run:
    git cp <commit-hash>

    Final Thoughts

    By setting up these Git aliases, you can reduce repetitive typing, speed up your development process, and make your Git usage more efficient. Once you’ve incorporated a few into your routine, they become second nature. Don’t hesitate to experiment and add your own based on the commands you use most. Put these in your .gitconfig file today and start enjoying the benefits of a more productive workflow!

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleExtract Arrays from Any Data Type with Laravel’s Arr::from Method
    Next Article JS Dark Arts: Abusing prototypes and the Result type

    Related Posts

    Artificial Intelligence

    Last Week in AI #302 – QwQ 32B, OpenAI injunction refused, Alexa Plus

    June 13, 2025
    Artificial Intelligence

    LWiAI Podcast #202 – Qwen-32B, Anthropic’s $3.5 billion, LLM Cognitive Behaviors

    June 13, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    Why top SOC teams are shifting to Network Detection and Response

    Development

    Screen is a terminal renderer written in pure PHP

    Development

    Scaling Smarter with Cloud ERP Solution – Driving Business Growth

    Development

    CVE-2025-23097 – Samsung Mobile Processor Exynos 1380 Out-of-Bounds Write Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Highlights

    CVE-2025-5155 – FoxCMS SQL Injection Vulnerability

    May 25, 2025

    CVE ID : CVE-2025-5155

    Published : May 25, 2025, 8:15 p.m. | 41 minutes ago

    Description : A vulnerability has been found in qianfox FoxCMS 1.2.5 and classified as critical. Affected by this vulnerability is the function batchCope of the file app/admin/controller/Article.php. The manipulation of the argument ids leads to sql injection. The attack can be launched remotely. The exploit has been disclosed to the public and may be used. The vendor was contacted early about this disclosure but did not respond in any way.

    Severity: 6.3 | MEDIUM

    Visit the link for more details, such as CVSS details, affected products, timeline, and more…

    The AI for Science Forum: A new era of discovery

    May 13, 2025

    CVE-2025-47096 – Adobe Experience Manager Arbitrary Code Execution Vulnerability

    June 10, 2025

    Arolyn Burns

    May 7, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.