Git remote control, combined with GitHub for multi-person collaboration

Source: Internet
Author: User

First, it is:


git clone

Examples are:

git clone http://github.com/your account/your code repository. Git


Then you can get Git's local repository, which can be created in any folder. What is obtained is its code warehouse;

Second, then is:

To modify it, you will use: Git Add. ; Git commit-m ""; git diff and so on; the commands are detailed in my other blog posts, and I'll tell you how to use them.

Meger get the remote repository, merge and update the local warehouse;

Git pull

Examples are:

Git pull http://github.com/account/code repository. Git

At this point if your local file has been modified, and pull over the remote file has a content conflict: will show:

* Branch HEAD--Fetch_head

Auto-merging readme.md

CONFLICT (content): Merge CONFLICT in Readme.md

Automatic merge failed; Fix conflicts and then commits the result.

And it appears in the file:

<<<<<<< HEAD

=======


This is the statement used to validate pull.

This is the statement used to verify pull 2

This is the statement used to verify pull 3

>>>>>>> e93d7e4ce948e0bf99f48f06c1c9dd069c3a3325


How should we solve this?

Workaround One:

is delete <<<<<<< HEAD: the flag

Workaround Two:

is to use git checkout---theirs

Implementation of the merger, this benefit is can be bulk merger, the disadvantage is the loss of selectivity, we only--thires/--ours merger situation;

-----------------------------Fix the version merge issue---------------

Third, the GIT push implementation pushes the local version to the remote repository;

Examples are:

git push http://github.com/xiaohongqi2/xiaohongqi.git

Solve this to complete a set of multi-person collaboration operations;

Iv. cooperation for the realization of the equal rights of multiple persons;

If a git repository is built on a person's mainframe, then he has a lot of power, no pull or push.

In order to achieve multi-person collaborative development:

The workaround is to set up the Git repository on the lab server; Here I excerpt from Daniel's passage:

As follows:

Collaborative development of M2ge
In the previous section, the three-person and three-person cooperative mode of work is unreasonable, for example, the Lyr is too
Special, others have to Git-pull and Git-push, but he does not need. Now to deprive him of this privilege, the most
The effective way is to set up the M2ge warehouse on the lab server. 13
First, the Lyr logs on to the server via SSH, looking for the right location to create the M2ge.git directory, such as
/project/m2ge.git, and then initialize an empty warehouse as the M2ge warehouse:
$ mkdir-p ~/project/m2ge.git
$ CD ~/project/m2ge.git
$ git--bare init--shared
In the above operation, the--bare option of the Git-init command allows the M2ge.git directory to be equivalent to a single bin
Library. In other words, M2ge.git was originally a working tree, but the--bare option would have been stored in
The contents of the warehouse in the m2ge.git/.git are all placed in the M2ge.git directory, as if the warehouse is completely bare
Exposed in the working tree, so called the Naked Warehouse.
The Lyr then pushes the M2GE repository on its machine that has already been managed by Git to the server-side
M2ge.git Warehouse:
$ CD ~/work/m2ge
$ git push [email protected]:~/project/m2ge.git master
The meaning of the master parameter that appears in the above Git-push command is described in the next chapter, where you can skip
Don't talk about it. Now that you've got the original version of the M2ge repository, you can use the Git-clone command
To create a working directory locally:
$ git clone [email protected]:~/project/m2ge.git
After that, we can start one cycle after another, and the M2ge.git warehouse on the server will be
Each co-developer's version update submission, this basic process can be referred to in the previous section
Solution.


This is the solution;

Note that the request can be made with HTTP; SSH and so on, want to know how to use the specific commands, please find the explanatory documents;


Please pay attention to the small red flag my blog is: Http://blog.csdn.net/happylaoxu point I visit Http://blog.csdn.net/happylaoxu

Reprint please indicate the source;


Next I want to explain the more advanced things, please continue to pay attention;


Git remote control, combined with GitHub for multi-person collaboration

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.