Use the GIT client in windows, the GitHub source code library, and the GIT plug-in egit of eclipse

Source: Internet
Author: User
Tags git client how to use git using git asymmetric encryption

Use the GIT client in windows, the GitHub source code library, and the GIT plug-in egit of eclipse

 

#{

// V0.1 // 120314

Simple record

// V0.2 /// 120316

Small Modification

// V0.25 /// 120317

Typos, sentence, layout, paragraph segmentation, etc.

// V0.29 // 120317-2

Corrected the understanding error of the local code library and added more professional description resources.

 

}#

 

During this time, the company's source code library was migrated from SVN to GitHub, and the process of switching from SVN to git experienced some twists and turns. Here we will record it briefly.

 

About git and SVN

I didn't understand the difference between git at the beginning. I thought it was almost less than SVN. I used it a little bit and found that the difference was great.

 

SVN
First, SVN creates a source code database at the remote or local end. Both source code and version changes are recorded in the database. the current local project is hidden. SVN file, which records metadata of the current project so that the local current project can be connected with the information in the source database.

Git
Git requires a local source code repository to record the project metadata. some people may be confused here, because they may see two situations. Someone will build a source code repository for a project, and someone will use a centralized source code repository. Generally, the latter should be used. when code change is submitted, the commit is submitted to the local source code library. then there is a git server at the far end, such as GitHub, which is actually the location of another source code repository. here, the concept of push and pull is introduced. It seems that git pays more attention to the concept of synchronization. no matter how many times you commit locally, the source code library of git server will not change. What you need to do now is to synchronize the local source code library with the remote source code library! This is the key. You need to use push to push the changes to the source code library. as for pull, of course, it is dragged down. these benefits are obvious, and you can use the version control function at any time.
But here I still have some points that I don't understand, that is, how to solve the synchronization conflicts between different versions of libraries during multi-person development, because it is actually one step more than SVN, and I don't know if it will be very troublesome, follow-up Study.

See patch-v0.29

 

Use git on Windows & eclipse
Windows is a second-class citizen in the professional field. If you don't mention it, don't mention it --

How to Use git in eclipse?

You must know that since it is eclipse, there will be a plug-in. Well, this legendary plug-in is called egit.
It seems that eclipse already comes with this source. You can directly search for this plug-in or manually download it from the source, but eclipse does not give this source a name, if you add a source, you will be prompted that the source already exists.

You can:
 
1 help-> install new software
2. Click "available software sites" in the bottom line of the top input box"
3. Can I see "Type Filter text? Enter "egit", select, edit, and name. Enter "egit"
4. Come back. In this case, egit should be included in the drop-down menu of the plug-in source. You have chosen and installed all the mess. You must have done it many times.

This egit is not a GUI, but an executable command tool, but it is still in development... yes, it will be a little painful.

Now, right-click the project, and the functions in "team" are the GIT functions. Don't confuse them with the projects managed by SVN.
For basic usage, refer to the following:
Http://jiangli.easymorse.com /? P = 783

And here:
Http://www.open-open.com/lib/view/open1328435726296.html
This is a series of articles, but some of them are outdated or not detailed, so they are for reference only. think more, don't be afraid.
For example, "Use or create repository in parent folder of Project", I won't do this. For example, if you put it in the eclipse workspace, it will be messy. I think it is good to find a place to store it in a centralized manner.

The Home variable is the directory that stores the configuration file.

You will encounter "Ref", "Master", and "branch". First of all, I am not sure --
However, ref should refer to the reference of the project. For example, a branch is also a ref, It is a variable, and the head is the last project to enter the warehouse, Master, as the name suggests, it is also a branch.

The above is the basic practice of using git in Eclipse IDE on Windows. Below, we need to combine it with GitHub --

Bytes -----------------------------------------------------------------------------------

First, if you migrate data from SVN, GitHub has an option that you can import data directly from the svn repository. Then, see the following:

 

Do not be redundant
On the GitHub official website, there is a command line git tool usage tutorial, which is the egit package. Follow the configuration in this tutorial and take a look at the basic command usage.
Http://help.github.com/win-set-up-git/, first see download and install git here first.

 

Transmission protocol and key verification

Next, let me talk about it. It seems that git transmission uses the SSH (usually SSH2) protocol by default. Of course, other common transmission protocols can also be used. the SSH2 protocol has multiple authentication methods: Password, password plus certificate, or pure certificate. The certificate refers to the asymmetric encryption key. You can hold the private key and put the public key on the server, then, the server will know you are on both sides.
GitHub uses this private key and public key pair for verification. Of course, there are also HTTP protocols, which are actually https, but I don't know if it was attacked some time ago, it is important to upload the project for the first time. Anyway, the first push project must be in the SSH2 mode before you can see the link in the HTTPS mode. You may be able to directly Use https. those who work on the wall may know some SSH2, but those who often deal with win and those who don't deal with Linux may be unfamiliar, because win doesn't support ssh2.

So to upload your project on GitHub, first you have to have an RSA key pair. Well, eclipse has this tool,... don't use it. There are hosts files in the wood, so I am stuck here for a day. Yeah, Nima needs a hosts file. therefore, the previously installed git Bash is useful.
After reading the http://help.github.com/win-set-up-git/, I will add that the default SSH key file under Linux seems to be in. in the SSH folder, the default location of win is under the SSH folder of the user directory (don't ask me what the ghost horse is calling the user directory---, open CMD and check the default path, complete the full set according to the official recommendations.

The most important thing is to copy the generated key and hosts file to the SSH folder of the current user directory. The user directories of win7 and XP are different.

Before I generate the hosts file, I used egit to push it.

"Warning: Permanently added 'github. com, 207.97.227.239 '(RSA) to the list of know hosts.
Permission denied (publickey )"
This shit problem. I haven't found it out for a long time. stackoverflow has also read it and I haven't made it clear. It's because of the hosts file issue.

......

Thank God for seeing "... access.

In the following command line, let's familiarize yourself with the configuration of user. Name. Similar settings in egit mean that you can directly edit the configuration file using a text editor.

 

T_t

 

Then !!

Then, you can finally use egit push in eclipse, and then commit and push again. If there is no goods available locally, you have nothing to push. play out the account password Shenma, GitHub version library location will give you a link, such as "git@github.com: xxbirdman/xxproject. git ", this is the SSH2 link, which is entered in the first Uri and will help you fill in later. you do not need to start the Protocol either.

 

Key points:
Well, kids shoes, maybe you are very smart, but remember that although only git is written in the following account password location, do not fill in the GitHub account password with your own preferences, otherwise, you will be very painful. For example, if the dog blood problem of Shenma "exception caught during execution of LS-Remote Command" occurs, the reason is very simple. GitHub adopts the pure RSA verification method, as long as your private key is configured with a public key, you can log on to it with a public account git. You do not need to add an account password to your private key. This will lead to an error. If you use HTTPS in the future, then you can fill in the account password. Remember to remember the password and jump to it. Then, we recommend that you click "add all branches spec" and finish. here is to let you choose which branch You Want To synchronize to the local version library. Each branch is a ref, and the master is also a branch, Head, you know, most people should synchronize data --

Here, it seems that branch, trunk, and tag, which are commonly mentioned throughout the day by default in SVN, are a little different. In fact, there is no essential difference. You should regard trunk and tag as a branch.

 

By the way, the little turtle also has a git version called tortoisegit, you know.

Finally, I would like to thank you for sharing the information. You can refer to the following link:

GitHub help
Http://help.github.com/

Chinese translation of official documents
Http://blog.csdn.net/xianqiang1/article/details/6944042

Git Chinese magic book // Manual, with patience
Https://docs.google.com/View?

Id = dfwthj68_675gz3bw8kj & PLI = 1 # _ 201741281264953870145_601701371_489039059728384

Eclipse git plug-in egit user manual, this series of articles really good, again recommended
Http://www.open-open.com/lib/view/open1328435802187.html

This is what t_t was shared by a big brother who once had the same bad fortune when he encountered a tough problem.
Http://blog.csdn.net/ddlylly/article/details/7095809

Here is a glimpse of how the eclipse tool generates an RSA key pair.
Http://freewind.me/blog/20111114/578.html

Http://www.cnblogs.com/babykick/archive/2011/12/01/2271299.html
Http://www.lixinyang.com/2011/05/windows-eclipse-github/
Http://blog.sina.com.cn/s/blog_6b8d6ed60100zndn.html

 

I only wanted to write a little bit at will. The result seems to have been used for about two or three hours. It is a bit messy and not very detailed. I am not familiar with the use of the command line. Please try again later,

Thank you for sharing your experience. If you have any mistakes or do not understand them, please help us to point them out.

 

 

 

 

 

= Fill = Ding =

 

-- V0.29

Supplement: I have an incorrect understanding of the local git code library. I have found two articles to introduce the idea and working methods of git for your reference. to be honest, it's really troublesome. I want to get rough. I have a headache --#

Http://www.cong (chrysanthemum) ci.com/item/git-and-github-services // remove Chrysanthemum

Http://www.open-open.com/lib/view/open1328069733264.html

Http://www.open-open.com/news/view/889e6

Http://blog.csdn.net/yihui8/article/details/6445847

How does cnblogs list (Cong (chrysanthemum) ci.com as a sensitive word ?)

--

Related Article

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.