What is git?
Git is a distributed code management container. The same code is stored locally and remotely. The GIT repository is mainly composed of three parts: Local Code, cache area, and commit history. This is the essence of almost all operations. But for the sake of simplicity and ease of understanding, the GIT rep
= 556a3e1e7ad1fde0a32823fc7e4d046bcfd86dae (refs/remotes/origin/trunk) Found Possible branch point:file:///tmp/test-svn/trunk = file:///tmp/test-svn/branches/my-calc-branch, a Found branch Parent: (Refs/remotes/origin/my-calc-branch) 556a3e1e7ad1fde0a32823fc7e4d046bcfd86dae following parent with Do_ Switch successfully followed parent R76 = 0FB585761DF569EAECD8146C71E58D70147460A2 (refs/remotes/origin/ My-calc-branch) Checked out Head:file:///tmp/test-svn/trunk R75
This is equivalent to runni
Git is currently the most popular version management system. Learning git has almost become a required skill for developers.
Git has many advantages, one of which is that remote operations are very simple. This article describes five git commands in detail, their concepts and usage, and understanding the content, you w
Source: Ruan Yifeng
Git is currently the most popular version management system. Learning git has almost become a required skill for developers.
Git has many advantages, one of which is that remote operations are very simple. This article describes five git commands in detail, their concepts and usage, and understandin
//Delete a branch, whether or not a merge is forced to delete
When you clone from a remote repository, actually git automatically corresponds to the local master branch and the remote Master Branch, and the default name of the remote Repository is origin.
To view information for a remote library, use git remote:
$ git remote
Origin
Or, use
the associated Origin host branch
The "Git Pull" operation is actually equivalent to performing a "git fetch" to get the remote update, and then the "Git merge" is merged with the local branch.Of course, the pull command also supports merging using the REBASE mode:Git pull--rebase In this case, "
Download the remote version but not merge it into the HEAD:
$ git fetch
Download the remote version and automatically merge it with the HEAD version:
$ git remote pull
Merge the remote version into the local version:
$ git pull origin master
Publish the local version to the remote end:
$
when useful $ git diff [file] # Compare the current file and the staging area file difference $ git diff [$id] [$id] # Compare the differences between two commits $ git diff [Branch1]. [BRANCH2] # Compare $ git diff--staged # between two branches compare staging area and repository diff $
One, git introduction what is git? Git is an open source Distributed version Control tool in all of the world's distributed version control tools, Git is the fastest, simplest, and most popular git origin author is the father of Linux: Linus Benedict Torvalds developed
take a look at the "--bare" option used when setting up a central server.The GIT init--bare method creates a bare repository, which is called a bare repository because it stores only the version information submitted by Git history and does not allow the user to perform various git operations on it.There is a bare repository because the repository initialized wi
file and the saved file-staged // The Difference Between the saved file and the last submitted file.Git commit-am "txt" // submit the files in the temporary storage area and modified files to the warehouse txt for record.Git log // you can view the submission history through gitg.Git fetch pd // capture data from the remote inventory pd Library to the local git pull.Git pushes the pd master // pushes the l
remote --verboseorigin seth@example.com:~/myproject.Git (fetch)origin seth@example.com:~/myproject.Git (push)An origin remote database is very useful because it has the remote backup function and allows others to work on this project. If cloning does not inherit the origin remote database, alternatively, you can run the git remote command:$ git remote add seth
download and the SSH protocol is used for applications requiring user authentication. For a detailed discussion of the pros and cons of the various protocols, please refer to official documentation.Second, git remoteFor ease of administration, GIT requires that each remote host must specify a host name. The git remote command is used to manage host names.With no
SVN.First look at the structure of the sample project, the warehouse path is file:///d/Projects/svn_repo2 . The main branch of this project is the Dev folder, and the Branch1 and Tag1 folders represent a branch and tag respectively.SVN Project structure:
1234567
/d/proj2├──branch1│└──file1.txt├──dev│└──file1.txt└──tag1└──file1.txt
Clone from SVNCommand:git svn clone Example:git svn clone file:///d/Projects/svn_repo2/dev proj2_svnAdd Remote Branch InformationComma
. Other branches are created by hand.Some common branching strategies are listed below:Create a personal work branch of your own that avoids too much disruption to master Branch master and facilitates communication and collaboration with others;Create an experimental branch when doing high-risk work;When merging other people's work, it is best to create a temporary branch for merging, and then "fetch" your own branch after the merge is complete.The br
Features:
1. You can quickly switch between project branches.
2. roll back the version of a branch.
3. You do not need to modify the configuration file (defined for projects) for each branch switch)
4. You do not need to create/switch virtual directories/domain names because they are all in the same directory.
5. Are these attractive to you? If you like it, join in.
What is git?
Git is
data, not automatically merged: git fetch (2) retrieve updates from a branch of the remote host and merge them with the specified local branch: git pull Retrieve the next branch of the origin host and merge it with the local master branch: git pull origin next: master
If the remote branch is merged with the current br
hosts.
$ git Remote
origin
Use the-V option to refer to the remote host's web address.
$ git Remote-v
Origin git@github.com:jquery/jquery.git (fetch)
origin Git@github.com:jquery/jquery.git (push )
The above command indicates that there is curren
Always use the Sourcetree software to image the operation of git, but feel a lot of git remote operation commands are still necessary
One of the many advantages of git is that remote operations are simple. This article describes 5 git commands in detail, their concepts and usage, and you get a complete grasp of
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:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.