# Boost Your Git Productivity: A Simple Dev's Guide to Git Aliases with Real Examples

---

#### Ever feel like you’re typing the same long Git commands over and over again?

If you’re a developer (especially a frontend or Angular developer), Git is part of your daily life. But let me ask you: **What if you could save time, avoid typos, and streamline your Git workflow — all by typing just a few letters?**

By the end of this article, you’ll know:

* What Git aliases are and why they matter
    
* How to create your own Git aliases (with real examples)
    
* Some **must-have aliases** for frontend developers
    
* How to make them global and persist across projects
    
* Bonus: How to alias complex commands and combine flags like a pro
    

So grab a cup of chai (or coffee ☕) — let’s optimize your Git life.

---

### What Are Git Aliases?

A **Git alias** is a custom shortcut you define to avoid typing long or repetitive commands.

Think of it like a speed dial for Git.

Instead of typing:

```bash
git status
```

You can just type:

```bash
git s
```

And it works the same. Magic? Nope. Just smart config.

---

### How to Set Up a Git Alias (Step-by-Step)

Git stores aliases in your `.gitconfig` file.

To add one, you can run this command:

```bash
git config --global alias.s status
```

Now whenever you type:

```bash
git s
```

It will run `git status`. Simple, right?

---

### Must-Have Git Aliases for Developers

Here are some popular and **time-saving aliases**:

```bash
git config --global alias.s status
git config --global alias.c commit
git config --global alias.ca 'commit -a'
git config --global alias.cm 'commit -m'
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.hist "log --oneline --graph --decorate --all"
```

> *Tip: You can open your ~/.gitconfig file and edit aliases manually too.*

---

### Demo: My Favorite Git Alias — The “Hist” Log View

This one is a game-changer for visualizing branches:

```bash
git config --global alias.hist "log --oneline --graph --decorate --all"
```

Then just run:

```bash
git hist
```

And you’ll see:

```bash
* a3c9d22 (HEAD -> main) Updated README
* 934a7cd (feature/login) Added login logic
* e1a8e5b Initial commit
```

It’s like Git turned visual!

---

### Advanced Git Aliases (with Parameters)

Yes, you can alias even **complex commands** like this:

```bash
git config --global alias.undo "reset --soft HEAD~1"
```

This gives you the power to “undo” your last commit, keeping changes in staging.

Usage:

```bash
git undo
```

Boom! Like Ctrl+Z for Git commits.

---

### Pro Tip: Use Functions in Bash or Zsh

Want to create more interactive or multi-step Git shortcuts? Use shell functions in `.bashrc` or `.zshrc` like this:

```bash
gpush() {
  git push origin $(git branch --show-current)
}
```

Now just type:

```bash
gpush
```

It’ll push your current branch automatically.

---

### Why Devs Should Care

As Angular/React developers, we switch branches, commit often, stash changes, and cherry-pick bug fixes. Git aliases let you do all this **faster and error-free**.

* Save time in daily workflows
    
* Reduce mental fatigue
    
* Look like a pro in front of your team 👨‍💻👩‍💻
    

---

### 🎯 Your Turn, Devs!

👀 **Did this article spark new ideas or help solve a real problem?**

💬 I’d love to hear about it!

✅ Are you already using this technique in your Angular or frontend project?

🧠 Got questions, doubts, or your own twist on the approach?

**Drop them in the comments below — let’s learn together!**

---

### 🙌 Let’s Grow Together!

If this article added value to your dev journey:

🔁 **Share it with your team, tech friends, or community** — you never know who might need it right now.

📌 Save it for later and revisit as a quick reference.

---

### 🚀 Follow Me for More Angular & Frontend Goodness:

I regularly share hands-on tutorials, clean code tips, scalable frontend architecture, and real-world problem-solving guides.

* 💼 [**LinkedIn**](https://www.linkedin.com/in/errajatmalik/) — Let’s connect professionally
    
* 🎥 [**Threads**](https://www.threads.net/@er.rajatmalik) — Short-form frontend insights
    
* 🐦 [**X (Twitter)**](https://twitter.com/er_rajatmalik) — Developer banter + code snippets
    
* 👥 [**BlueSky**](http://devrajat.bsky.social/) — Stay up to date on frontend trends
    
* 🌟 [**GitHub Projects**](https://github.com/malikrajat) — Explore code in action
    
* 🌐 [**Website**](https://malikrajat.github.io/) — Everything in one place
    
* 📚 [**Medium Blog**](https://medium.com/@codewithrajat/) — Long-form content and deep-dives
    
* 💬 [**Dev Blog**](https://dev.to/codewithrajat) — Free Long-form content and deep-dives
    
* ✉️ [**Substack**](https://codewithrajat.substack.com/) — Weekly frontend stories & curated resources
    
* 🧩 [**Portfolio**](https://rajatmalik.dev/) — Projects, talks, and recognitions
    
* ✍️ [**Hashnode**](https://hashnode.com/@codeswithrajat) — Developer blog posts & tech discussions
    

---

### 🎉 If you found this article valuable:

* Leave a **👏 Clap**
    
* Drop a **💬 Comment**
    
* Hit **🔔 Follow** for more weekly frontend insights
    

Let’s build cleaner, faster, and smarter web apps — **together**.

**Stay tuned for more Angular tips, patterns, and performance tricks!** 🧪

[✨ Share Your Thoughts To 📣 Set Your Notification Preference](https://forms.gle/mdfXEVh3AxYwAsKw5)
