Ci CD-02
Ci CD-02
The new branch that gets created will be the reference to the current state of your
repository.
Creating a New Branch
Main
Commit1 Commit2 Commit3 Commit4
23ad9ad 16b36c6 ad8621a 0e25143
branch1
To create a new branch and change to it at the same time, you can use the -b flag:
Changing Branches
To merge the changes from a different branch into your current branch, you can use
this command:
You would replace <branch-name> with the branch that you want to integrate into
your current branch.
Merging Branches
Master
Commit1 Commit2 Commit3 Commit4
23ad9ad 16b36c6 ad8621a 0e25143
branch1
Commit3
ab63faa1
To delete a branch, you can run the git branch command with the -d flag:
Recap:
Branches are fundamental to Git and there's lots you can do with them!
rename compare
Key ● Understanding Branching: You learned what
branching is and its significance in development.
Takeaways ● Branch Creation & Management: You're able to
create, switch, and effectively manage branches.
● Create a folder.
● Initialize a git repo within that folder.
● Create a readme file in the folder.
● Make changes to the readme file.
● Add the changes to the read me. Check the status of the repository. Then,
leave a commit message and check the status once more.
● What command should you use to check the status of the repository? Write
your answer in this readme.
● Make more changes to the readme file. Use the shorthand command to add
and commit changes.
● Check the history of the repository.
● What command should you use to check the repository's history?
Resources
Git Resources
● Git Handbook
● Git Flow
● Git Glossary
● Git Documentation
● Git Developer Beginner
● Git Config Cheatsheet
● Git Cheatsheet