Get unlimited access
Open in app
Home
Notifications
Lists
Stories

Write
Praj Basnet
Praj Basnet

Nov 26, 2020

·
1 min read

Git pull and automatically detect the current branch

Handy little shortcut I use when I run git pull so I don’t have to specify the current branch:

git pull origin $(git rev-parse --abbrev-ref HEAD)

I make this an alias of git pull so that I always get the branch first.

--

--

More from Praj Basnet

Love podcasts or audiobooks? Learn on the go with our new app.

Try Knowable

Recommended from Medium

Ayush Garg

Ayush Garg

Let’s Deploy Wordpress-MySQL Infrastructure on Google GKE

Abhishek Gupta

Abhishek Gupta

in

ITNEXT

Beyond Pods: how to orchestrate stateless apps in Kubernetes?

Irakli DD

Irakli DD

SQL “Dummy” Table, CTE and Pivot — Simple Example

Bruno Noriller

Bruno Noriller

The pitfall of tutorials: no one codes like that

Brooke K. Ryan

Brooke K. Ryan

How to Find an Easy First Issue in an Open-Source GitHub Project

Dong Xia

Dong Xia

Basic Ruby — Class

Zain Raza

Zain Raza

Designing Bigger and Better Software (Beginner-Friendly!)

Sam Richard

Sam Richard

in

featurepreneur

Must know Basic Ubuntu Commands

AboutHelpTermsPrivacy


Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Praj Basnet

Praj Basnet

More from Medium

Netanel Haber

Netanel Haber

Concurrency

The almighty GIL
Avinash Dhakne

Avinash Dhakne

Parallel, Distributed and Concurrent Systems

Gaetan Bloch

Gaetan Bloch

3 reasons why nobody wants to review your pull requests

Kirti Gupta

Kirti Gupta

What to look for in a Code Review

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Knowable