Django Project: The project environment to build ---- Third, create a project code pushed onto the cloud platform code & cloud

Third, create a project in the cloud platform code

git service platform:

  • The main use github (most mainstream)

    • Slow-country visit

    • Private fee-hosting

  • General domestic use code cloud gitee

    • Domestic access speed

    • Hosted private items free (limit the number of developers)

  • The company used to build gitlab or svn

To create a

1. License cloud account registration

2. Create a warehouse

  1. After logging cloud code by "+" the upper right corner of the site, select "New Warehouse" page to enter the new warehouse

     

     2. Fill in the information warehouse

     

     3. Click on "create" to the code cloud created on your first warehouse.

3. Generate ssh public key

ssh-keygen -t rsa -C '[email protected]'

Follow the prompts to complete the three-carriage return, you can generate ssh key. By looking at ~/.ssh/id_rsa.pubthe file contents, access to your public key

cat ~/.ssh/id_rsa.pub
# ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6eNtGpNGwstc....

Copy the ssh key after generation, by setting Home "SSH public key" -> "add the public key" , adding public key generated to the warehouse.

 

 

4. Cloning into the local project

Copy ssh link

Project to clone a virtual machine or physical machine can be.

I git clone [email protected]: Tmclr of / django2.git

 

 

5. Add a remote repository

If it is the first established in the local project, and then create a remote repository in the cloud on the code, then the operation is as follows.

  1. First, cd to django project root directory, then create a local git repository

    cd ~/project/tzporject
    git init
  2. Then add a remote repository
    git remote add origin  [email protected]:wcflove/tztz.git

     

Fourth, the project will be pushed to the cloud code

Manual synchronization code (more secure), and then run django service, check and correct after you can submit code, then push the code to the cloud

  • Write .gitignore file

    To make git run faster, some do not need to add to the repository of documents such pycharm project settings file .idea folders can be set to ignore .idea folder by .gitignore file, at the end of the file add the following .gitignore two lines

    ....
    # pycharm
    .idea/

     

  • Configured to push people's identity information (fill in your name and email address)
    $ git config user.name "Tmclri"
    $ git config user.email "[email protected]"

     

  • The code is pushed to a local warehouse
    # Workspace added to the staging area 
    $ git add. 
    Submit to the warehouse staging area # 
    $ git the commit -m ' Project the init '

     

  • Cloud push code symbol
    $ git push origin master

    Note that if there is, you need to push fails to run strong push

    $ git push -f origin master

    Code clouds appeared, the code you write this

Guess you like

Origin www.cnblogs.com/Tmclri/p/11517826.html