5/27/2023 0 Comments Git visualize branches![]() ![]() Switch between branchesSwitch/jump to the new branchgit checkout newBranchSwitch back to master branchgit checkout master4. Create a branchProject: learn_branching-git list branches using the command: git $git branch iss53 * master new-feature newBranchCreate a new branch from the latest commit-create branch gitgit branch newBranchCreate a branch from an old commitgit branch firstBranch commitIDCreate a branch and jump onto itgit checkout -b quickfix3. ![]() | |/ |/| | | * 43d4441 (tag: new, myProj/master) Update README to version 3.2 | | * 0f491ba (myProj/issue) Merge branch 'master' of | | |\ Set an alias for this command in the config filegit config -global alias.showbranches 'log -graph -oneline -all -decorate' git showbranches2. | | * 7287290 (preprod, development) Adding main function | |/ |/| | | * 820c0e8 (origin/iss53) end of bug fix.Tested. * | c5487f5 adding quickfix |/ | * dff8df9 (HEAD -> master, origin/master) 2 commit: hello.sh code file added. * 4871096 1 commit: Initial Project structure and Readme file added.#To visualize the graphical logs for all the branchesgit log -graph -oneline -all -decorate-decorate: adds labels to the commits (HEAD, tags, remote branches and local branches)* 277c573 (quickfix, iss53) Merged branch iss53 into quickfix |\ | * 13fbd09 iss53 bug fixed. What is a branch and visualize branchesIndependent line of development or parallel development of code along with the main code.Branches are used to develop a new feature or to fix a bug in the code.In other words:Branch is a reference to a commit.cd learn_branching#To visualize the graphical logs for current branchgit log -oneline -graph * dff8df9 (HEAD -> master, origin/master) 2 commit: hello.sh code file added. ![]()
0 Comments
Leave a Reply. |