Day 11 : 90DaysofDevOps : Advance Git & GitHub Part-2

Day 11 : 90DaysofDevOps : Advance Git & GitHub Part-2

Git Stash

Git stash is a command in Git that temporarily saves changes that are not yet ready to be committed. It allows users to switch to another branch or make changes to another part of the code without committing unfinished work. The stashed changes can later be reapplied with the git stash apply command.

Cherry-pick:

Cherry-pick is a Git command used to apply specific commits from one branch to another. It allows users to select and copy individual commits, rather than merging entire branches. This is useful when only specific changes are required in a different branch. GitHub also supports cherry-picking via its web interface.

Task-01

  • Create a new branch and make some changes to it.

    Use git stash to save the changes without committing them.

  • Switch to a different branch, make some changes and commit them.

  • Use git stash pop to bring the changes back and apply them on top of the new commits.

Task-02

  • In version01.txt of development, the branch adds the below lines after “This is the bug fix in development branch” that you added in Day10 and reverted to this commit.

  • Line2>> After bug fixing, this is the new feature with minor alterations”

    Commit this with the message “ Added feature2.1 in development branch”

  • Line3>> This is the advancement of the previous feature

    Commit this with the message “ Added feature2.2 in development branch”

  • Line4>> Feature 2 is completed and ready for release

    Commit this with the message “ Feature2 completed”

  • All these commits messages should be reflected in the Production branch too which will come out from the Master branch (Hint: try to merge).