7.14 Git cherrypick (copying commit chanes from one branch to another)
Explaining with an example: Copying specific commit from feature-1 branch to master branch using Git cherry-pick Master branch : Feature branch : Steps : (i).
Explaining with an example: Copying specific commit from feature-1 branch to master branch using Git cherry-pick Master branch : Feature branch : Steps : (i).
replace pick with squash on before commit hash what you what to merge Then after if we see git log, the squash commit will not
Git rebase drop : dropping the commit
(i) Created 3 files with 3 commits as below FILE NAME COMMIT MESSAGE 1 file-A file-A-commit 2 file-B file-B-commit 3 file-C file-C-commit (ii) Let’s add
Git Rollback(git reset) : (i) Creating project with 3 files with 3 commits FILE NAME COMMIT MESSAGE file-A file-Commit-A file-B file-Commit-B file-C file-Commit-C (ii) Try
** feature-1 is developed long back** after feature-1 , master got added another features** if we directly merge child(feature ) branch to master branch all
Task : Copy a commit from feature-1 branch → master branch (i). Checkout to feature branch(Here I Created feature-1 branch, Added f1,f2 files and committed)
Steps to merge : (i) First we have to checkout to a branch where we need child/feature branch files and commits git checkout master (ii)
To mark commit good with bisect(bisect used for debugging) git bisect good <commit-id> To mark commit bad with bisect git bisect bad <commit-id> To list
We can see the log responce , six is renamed as six-two.txt