Skip to content

A collection of tips and tricks to level up your git usage.

License

Notifications You must be signed in to change notification settings

GitToolbox/git-tricks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitToolbox logo
Github Build Status License Created
Release Released Commits since release

Overview

This is a collection of tips and tricks to level up your git usage.

Get the default branch for a given repository

git remote show origin | grep 'HEAD' | cut -d':' -f2 | sed -e 's/^ *//g' -e 's/ *$//g'

Get the latest tag from a repository URL

git -c versionsort.suffix=- ls-remote --tags --sort=v:refname https://github.com/GitHooksToolbox/prompt-default-branch-commit-deprecated '*.*.*' | awk -F/ '/refs\/tags\// {print $3}' | tail -n1

About

A collection of tips and tricks to level up your git usage.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

  •  
  •  

Packages

No packages published