This is the second day of my participation in Gwen Challenge

preface

Git is the most powerful branch function, and the following is mainly around the branch to explain ~ small bench ready? Let ‘s go!

Git branch

Git has a default branch (the main branch) that points to the current commit object. Git branch: Git branch: Git branch: Git branch: Git branch: Git branch: Git branch: Git branch: Git branch HEAD file: The file indicates the branch currently checked out (which branch is currently in). Refs folder: A branch (pointer) that stores submitted objects pointing to data. Old link, direct above ~.

We can use the hash value stored in the master, and then we can use the command to check what we said above, obviously to verify what I said above. Since there are main points ** there must be other ah, with our black hair continue to look below!

A high level command of a branch

  • Git branch name creates a branch (pointer) that can be moved.
  • Git config –global alias Alias command is used to configure an alias.
  • Run the git branch -d name command to forcibly delete an unmerged branch.
  • Git log –oneline –decorate — graph-all

Git config –global alias. DNF “log –oneline –decorate — graph-alli

  • Git checkout name switch to the branch whose name is name.
  • Run the git branch -d name command to forcibly delete an unmerged branch.
  • Usage Scenarios: Like you have a project running stable first, but you suddenly skull a bright thought of a new idea, we certainly can’t modify on the original project at this time we should create a new branch and are working on the new branch, if you achieved his thoughts on new branch by branch merge together, let it in the project If you don’t do what you want, delete the new branch and go back to the old branch. Without further ado, illustration above! Git novices should try it themselves! So I’m new to this lol)

  • Git branch commitHash creates a branch and points it to the appropriate commit object. This is a very silly command for version-crossing, but remember to use git checkout to switch branches.

Git branches are essentially a pointer to a submitted object. The branch name is simply the name given to the current submitted object. Branch switch version shuttle through the HEAD pointer.

Second, the end

At this point, the Git branch function basic explanation is finished, the next article is sure to Git branch practice, learned new knowledge that must practice a hand ha ha ha, if feel useful can point a thumb-up oh! I will continue to update, if there are any mistakes please point out, thank you for your audience master.

To get a PDF of the above content, go to GitHub and download it.

Address: Git study notes area

— — — — — a romantic