Advanced Git by By Chris Belanger & By Chris Belanger and Jawwad Ahmad & By Jawwad Ahmad
Author:By Chris Belanger & By Chris Belanger and Jawwad Ahmad & By Jawwad Ahmad
Language: eng
Format: epub
Publisher: Ray Wenderlich
Youâve seen that checkout simply moves HEAD to a particular commit. reset is similar, but it also takes care of moving the branchâs label to the same commit instead of leaving the branch label where it was. reset, in effect, returns your working environment â including your branch label â to the state a particular commit represents.
Consider again the example above, with a simple branch, mybranch, off of main:
This time, you execute a reset command with a target commit of b1:
Both HEAD and mybranch have now moved back to b1. This means youâve effectively discarded the original tip commits of the mybranch branch, and stepped back to the b1 commit.
But what happens to the tip commit thatâs now separated from the b1 label?
From Gitâs perspective, it doesnât exist anymore. Git will collect it with its regular garbage collection cycle, and any commits you make on mybranch will now stem from the b1 commit as their ancestor.
In this way, reset is quite useful when youâre trying to âroll backâ commits youâve made, to get to an earlier point in your repository history. reset has a lot of different use cases for it, and with it several options to learn about that change its behavior.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Exploring Deepfakes by Bryan Lyon and Matt Tora(7736)
Robo-Advisor with Python by Aki Ranin(7633)
Offensive Shellcode from Scratch by Rishalin Pillay(6110)
Microsoft 365 and SharePoint Online Cookbook by Gaurav Mahajan Sudeep Ghatak Nate Chamberlain Scott Brewster(5032)
Ego Is the Enemy by Ryan Holiday(4959)
Management Strategies for the Cloud Revolution: How Cloud Computing Is Transforming Business and Why You Can't Afford to Be Left Behind by Charles Babcock(4438)
Python for ArcGIS Pro by Silas Toms Bill Parker(4187)
Elevating React Web Development with Gatsby by Samuel Larsen-Disney(3893)
Machine Learning at Scale with H2O by Gregory Keys | David Whiting(3632)
Learning C# by Developing Games with Unity 2021 by Harrison Ferrone(3285)
Speed Up Your Python with Rust by Maxwell Flitton(3232)
Liar's Poker by Michael Lewis(3227)
OPNsense Beginner to Professional by Julio Cesar Bueno de Camargo(3195)
Extreme DAX by Michiel Rozema & Henk Vlootman(3172)
Agile Security Operations by Hinne Hettema(3124)
Linux Command Line and Shell Scripting Techniques by Vedran Dakic and Jasmin Redzepagic(3109)
Essential Cryptography for JavaScript Developers by Alessandro Segala(3083)
Cryptography Algorithms by Massimo Bertaccini(3002)
AI-Powered Commerce by Andy Pandharikar & Frederik Bussler(2983)
