DEV Community

Gaëtan Redin
Gaëtan Redin

Posted on • Originally published at Medium on

3 2

My Favorite Git Commands

Git aliases

I centralize here all my favorite git command to easy use it and be faster.

git undo

How to undo the last commit

git config --global alias.undo 'reset --soft HEAD^'
Enter fullscreen mode Exit fullscreen mode

Usage:

git undo
Enter fullscreen mode Exit fullscreen mode

git upd

How to update from a remote branch

git config --global alias.upd '!f() { git fetch origin && git rebase origin/$1; }; f'
Enter fullscreen mode Exit fullscreen mode

usage

git upd master
git upd develop
...
Enter fullscreen mode Exit fullscreen mode

git new

How to create a new branch

git config --global alias.new "checkout -b"
Enter fullscreen mode Exit fullscreen mode

usage

git new <my_branch>
Enter fullscreen mode Exit fullscreen mode

git st

How to see the current git status

git config --global alias.st "status"
Enter fullscreen mode Exit fullscreen mode

usage

git st
Enter fullscreen mode Exit fullscreen mode

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more