Common git commands
First, create a branch: Branchname represents the new branch name, otherbranchname remote branch name
1. Create a new branch based on the current
The previous article introduced Git's local basic operations, if you don't need to collaborate with others, such as writing a book yourself, writing a small program yourself, writing a website, and so on, it's almost enough. but sharing and collaboration is the theme of the free world, and Git is born for it, so try to be a student who loves to share and collaborate. ^_^The Git repository concept can be und
BKJIA Editor's note: this is the fifth article in the "Git Adventures" series. The translator LIU Hui translates Git Community Book to explain the branches and mergers in Git and how to deal with conflicts. If you do not know about Git, see Git adventures (1):
First, git new branch, upload code to the new branch I want to achieve the effect, that is, a parallel branch of multiple content, the main purpose is to facilitate the unified management of the same content of different projects, non-interference. : As long as I have a webpack_test project on GitHub, I'm building new
Use the git branch-a command to view all local and remote branches (git branch-r can view only remote branches)Found that many of the branches that have been deleted in the remote repository are still visible locally.
$ git branch
will contain a pointer to the last commit object (the parent object in the image below). After two commits, the warehouse history will look like Figure 3-2:
Figure 3-2. Link relationships between multiple commit objects
Now let's talk about branching. A branch in Git is essentially a mutable pointer to a commit object. Git uses master as the default name for th
In software development, bugs are like a routine, with bugs that need to be fixed, and in Git, because the branches are so powerful, each bug is repaired by a new branch, after the repair, the branch is merged, and then the temporary branch is deleted.When you receive a bug that fixes a code name of 119, it's natural t
instantly, no matter how you create, switch, and delete branches. Whether your repository is 1 files or 10,000 files.
Git encourages frequent use of branching and merging in the workflow, even if it does not matter many times in a single day. In the actual work, often fix a bug will use a branch to complete.
Once you understand the concept of branching and u
1, the purpose of the branch
Suppose you're writing an essay. You have written the first version and submitted a reviewer. Later, you get new data, and you're adding your data to the paper. In the process, the reviewer lets you change the format of your paper. Obviously, you cannot submit the version you are changing to them after you have modified the format. You only want to send them after the format has been modified on the basis of previous versi
Through the previous two articles in this series (see series: HTTP://WWW.CNBLOGS.COM/JEREHEDU/P/4607599.HTML#BBKZ), we already know how to use Git to do version control of the file. This time we continue to learn how to manage branching through git.First, we need to figure out what a branch is. With the git log command we can view the repository's commit log,So w
Remote Branch (branch) is the index of a branch in a remote repository. They are local branches that cannot be moved, and are only updated when Git is interacting with the network. The remote branch is like a bookmark that reminds you of the location of the previous
Master Branch and Dev branch already on GitHubOn a localgit checkout-b dev new and switch to local dev branchGit pull Origin dev local branch associated with remote branch=============================================================================================================== =ColorLinks: https://www.zhihu.com/qu
One, view remote branch
Use the following git command to view all remote branches:
Git branch-r1
Two, pull remote branch and create local branch
Method One
Use the following command:
git creates the branch and uploads the code to the new branch
Create a branch: I'm a new branch created directly under the project on GitHub, which I'll add later;
two uploading code to a new
disappointing ).
Feature branches often exist only in the developer's repository, rather than in the origin.Create a feature Branch
When developing new features, create feature branches from the develop branch.
$ Git checkout-B myfeature developSwitch to a new branch "myf
Git Branch is more flexible, if you use the branch when there is no good plan, will make the branch too much, in the merger when there are various problems, so must be in the team management of the branch have reasonable planning and design, Vincent Driessen An article a suc
Some mistakes may occur during git usage.
For example, execute checkout-F, reset-hard, or branch-D to delete a branch.
As a result, the local (remote) branch or some commit is lost.
At this time, we can use reflog to restore the service, provided that the lost branch or c
, which requires git merge even in fast A new merge Commit is also generated under the forward condition (here,--NO-FF is required to branch merge, which is intended to keep the original "Feature branches" integrity of the entire commit chain) git branch-d Myfeaturegit Push origin Develop12, "Release
When working on a project, it was much easier to work on features and bugs in isolation of the rest of the project. We can do the with GIT branches; A branch is a copy of the working directory, staging area, and project history; We create a branch, then check the it out and then add commits. After we feature have been
Git Branch Management
Almost every version control system supports branching in some form. Using a branch means that you can detach from the development thread and continue to work without affecting the mainline.
Some people call Git's branching model A "must-kill" feature, and it's because of it, it separates git fr
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
[email protected]
and provide relevant evidence. A staff member will contact you within 5 working days.