Team Development Tool-Git-Elementary Tutorial

The use of the team development tool Git, master the basic operation of Git, in the team development, greatly save time and improve efficiency.

        The domestic code hosting platform has Code Cloud (https://www.gitee.com)

        The foreign code hosting platform is GitHub (https://www.github.com)

        The difference between the two: Code Cloud provides individual developers with the right to use the private warehouse, and the company can open a hosting platform developed by a small team of 5 people for free; Github does not provide free private warehouse losses, and you need to pay to use the private warehouse.

        If the project you develop does not want to be published, for internal use, you can use Code Cloud.

        Steps to use the code hosting platform (here, take GitHub as an example, follow the steps below to complete the code submission.):

       1. First, the computer needs to install Git (download address: https://git-scm.com/downloads), and register a Github account (requires email address);

image

        2. The registration process is not introduced in detail. If the English is not good, can you translate it? (The following steps assume that you have registered your account and installed the git software.)

        3. After logging in to the github account

image

Click on the avatar

image

There is a SSH and GPG keys on the right, click

After entering

Choose NEW SSH key

You can write the title of the key at will, so you can remember it easily.

The key needs to be generated by yourself.


This page is here for the time being.

        4. For the initialization of the warehouse, I use win7 for demonstration.

I demonstrate these files and submit them to my github account.


Well, the first step is to connect your account first.

image

Select git bash here 

First configure your own git account and email

git config --global user.name "jomqiu"

git config --global user.email "[email protected]"

        Then, create ssh-key locally

ssh-keygen -t -C "[email protected]"

At this time, press Enter all the way.

imageAt this time, under your user folder, there is a .ssh folder with two files generated.

Then, the content inside the id_rsa.pub file. Copy and paste here (key):

image

After that, enter:

ssh -T [email protected]

Verification is successful

image

If this happens, the connection is successful

        5. Submit the code

git init

git remote add origin [email protected]:jomqiu/sqli-labs.git

git add .

git commit -m 'reasons for submission'

git push origin master


explain:

        git init will initialize the local warehouse and generate a .git folder under the folder, which contains the warehouse information, which was deleted by mistake. If you can't see it, maybe you have selected "Hidden File".

        git remote add origin must be written like this. After that, [email protected] is the same, but after the colon is your own github id, and the one after / is the warehouse address. Before uploading the code, the warehouse address must be Built.

        git add. is to add all files and folders in this directory. If you want to add the name of a single folder, just enter the file name.

        git commit -m must be written like this, the reason for your code update or submission in single quotes. It must be written.

        git push origin master push means remote push to the repository origin is the name of the default remote repository. master is the master branch. This means that the local master branch is pushed to the master branch of the remote code repository, and one is created if it is not available.


Guess you like

Origin blog.51cto.com/15080014/2642054