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.

--

--

--

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

Recommended from Medium

Wanna earn from bugs?

Bot Framework Composer — Introduction | Part 1

GameKit Real Time Multiplayer Tutorial

Anatomy of a Log4J Payload

Cloud Foundry Advisory Board Call, Feb 2022: Jammy Jellyfish Upgrade

Advanced Django Development: How to build a professional CMS for any business? (Part #6)

Chrysalis (IOTA 1.5) Phase 1 Now Live on Mainnet

AWS EC2 Auto Scaling Groups | CheatSheet

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

How to connect to a MySQL database with C# and WinForms.

Why Entity Framework(ORM) is better and more secure.

Version Control with Git

Using COM-objects from Python/JScript/VBScript