Suppose your git flow consists of creating a branch from main, implementing some features, and merging it back to main.
In this scenario, you want to know if your branch has diverged from main.
Let's say git log shows something like this:
$ git log --oneline --graph --decorate --all
* c36d102 (main) New commit on main
| * f5003c8 (HEAD -> develop) New commit on develop
|/
* c484b40 Where it has diverged
* ec3124d Initial commit
This output might be alright for few commits, but if there are more than a dozen, it starts getting polluted. The output of git ld is this:
$ git ld
* c36d102 (main) New commit on main
| * f5003c8 (HEAD -> develop) New commit on develop
|/
* c484b40 Where it has diverged
OBS: I took most of this code from a StackOverflow answer that I cannot find. If I do find, I will edit to include the source.
Awarded GitHub Star since 2023 βοΈ and Microsoft MVP since 2024 π· I talk about Open Source, GitHub, and Web Development.
I also run a YouTube channel called DevLeonardo, see you there!
Awarded GitHub Star since 2023 βοΈ and Microsoft MVP since 2024 π· I talk about Open Source, GitHub, and Web Development.
I also run a YouTube channel called DevLeonardo, see you there!
Yep, talking with you the other day gave me the idea for making this video aaaand I may or may not have borrowed an alias or two from the ones you showed me :D
Actually, most of the ideas for videos and articles come directly from chatting with colleagues and friends, so, thank you! π
I'm a passionate learner and sharer. I always try to give back to the developer community. I create mobile and Web applications by day. Games, Podcasts and Livestreams by night.
Awarded GitHub Star since 2023 βοΈ and Microsoft MVP since 2024 π· I talk about Open Source, GitHub, and Web Development.
I also run a YouTube channel called DevLeonardo, see you there!
Awarded GitHub Star since 2023 βοΈ and Microsoft MVP since 2024 π· I talk about Open Source, GitHub, and Web Development.
I also run a YouTube channel called DevLeonardo, see you there!
Newbie Data Scientist (Still) / Machine Learning / Natural Language Processing / Rasa Certified Developer, Enthusiast and Rasa Hero / Conversational Agent Psychologist ;-)
Awarded GitHub Star since 2023 βοΈ and Microsoft MVP since 2024 π· I talk about Open Source, GitHub, and Web Development.
I also run a YouTube channel called DevLeonardo, see you there!
I do have an alias that I use often. I call it
git ld, which is short for git log diverged.Suppose your git flow consists of creating a branch from
main, implementing some features, and merging it back tomain.In this scenario, you want to know if your branch has diverged from
main.Let's say
git logshows something like this:This output might be alright for few commits, but if there are more than a dozen, it starts getting polluted. The output of
git ldis this:OBS: I took most of this code from a StackOverflow answer that I cannot find. If I do find, I will edit to include the source.
Looks really useful, thanks for sharing!
I have seen these aliases before π
Yep, talking with you the other day gave me the idea for making this video aaaand I may or may not have borrowed an alias or two from the ones you showed me :D
Actually, most of the ideas for videos and articles come directly from chatting with colleagues and friends, so, thank you! π
If you wanna new ideas for your content or you wanna help with something you know where I am! π
Thank you, I normally create my Git aliases in my shell config, I never knew you could put them in Git configuration.
Thanks.
Glad to hear you found my video useful
!
Thank you so much for letting me know and enjoy your new fast way of editing aliases :D
Thank you for this helpful tip. I am going to save a lot of time π
Read about aliases before and never tried using in real time.
After reading this article have to try this immediately :)
Let's go! π
Let me know how it goes or if you find some aliases you enoy particularly :P
I create shell aliases for everything (lazier or more efficient? you decide haha)
For example, created the alias
glgforgit lgBasically something like this:
Nice, thanks for sharing.