Python django-7 git and project

Source: Internet
Author: User
Tags version control system git clone

    • The use of Git, mainly includes:
      • Commands for the Local warehouse
      • Commands for remote warehouses
    • Project requirements, page, model class design, and page usage
About Git
    • Git is currently the world's most advanced distributed version control system
    • Installation
sudo apt-get install git
    • After the installation is successful, run the following command
git

Remote Warehouse
    • Git is a distributed version control system, and the same git repository can be distributed across different machines. First find a computer to act as the role of the server, 24 hours a day, everyone else from the "server" to clone a copy to their own computer, and each to push their own submissions to the server warehouse, but also from the server warehouse to pull someone else's submission. You can build this server yourself, or you can use the GitHub website
Create a GitHub account
    • The transfer between the local git repository and the GitHub repository is encrypted via SSH
    • Step1: Create SSH Key for project
ssh-keygen -t rsa -C "[email protected]"
    • After creation, find the. SSH directory in the user's home directory, there are Id_rsa and id_rsa.pub two files, these two are SSH key key pair, Id_rsa is the private key, can not be leaked out, Id_rsa.pub is the public key, you can safely tell anyone
    • step2:* Login to GitHub registration or login account, open the "Settings" SSH Keys page, then, click "New ssh Key", fill in any title, in the Key text box paste id_rsa.pub file content, click "Add Key", You should see the key already added
Create a remote Library
    • Login to GitHub
    • In the upper right corner, find the "new Repository" button to create a new warehouse
Cloning from a remote library
    • Clone a project on GitHub to a local copy
git clone [email protected]:账号名/项目名.git
Interacting with remote libraries
    • Get to local from remote library
git pull
    • The remote library will be submitted locally
git push origin master
    • Tip: You need to get it before each commit, resolve the conflict and resubmit it again
Local Warehouse Create local warehouse
    • Create an empty directory
mkdir test7cd test7
    • The directory structure diagram is as follows:

    • Create a local warehouse under the directory
git init
    • After successful creation, the directory structure is as follows:

    • Repository is a directory, all the files in this directory can be managed by git, each file modification, deletion, git can track, so that any time can track history, or at some point in the future can "restore"
File Management
    • The local warehouse is divided into three parts: work area, staging area, warehouse area, where staging area, warehouse area is the repository part
    • Three sections of operations and commands such as

Work area and staging area
    • Open a directory with the IDE, create a project, add files to staging area
git add 文件1 文件2 ...git add 目录
    • Restore the contents of the workspace using the contents of a temporary zone
git checkout -- 文件名
    • View the status of staging area
git status
Staging Area and warehouse area
    • Add a record of a staging area to the warehouse area
git commit -m ‘本次提交的说明信息‘
    • View the history of the warehouse area
当前版本的历史版本:git log简版显示:git log --pretty=oneline历史命令:git reflog
    • In Git, the current version is represented by head, which is the latest commit 3628164 ... 882E1E0 (Note that my submission ID and your affirmation is not the same), the previous version is head^, the last version is head^^, of course, 100 to write 100 ^ more easy to count, so write head~100

    • Compare the differences between a version of a file in a workspace and a warehouse area

git diff HEAD -- 文件名
    • Fallback historical version to staging area
git reset HEAD^或版本号
deleting files
    • Execute the following command sequentially
rm 文件名git rm 文件名git commit -m ‘说明信息‘
Project design
    • This is a vertical e-commerce, only for fresh fruit of an e-commerce platform
    • Issued page
    • Implementation features: Home, List page, display page, shopping cart, order, user login registration, User Center
    • Group to complete development, a team of 4-5 people
Model class Design
    • User UserInfo
      • Uname
      • Upwd
      • ...
      • Isdelete
    • Product Category TypeInfo
      • Ttitle
      • Isdelete
    • Product Goodsinfo
      • Gtitle
      • Gtype
      • Gprice
      • Gdesc
      • Isdelete
    • Shopping Cart Cartinfo
      • User
      • Goods
      • Count
    • Order OrderInfo
      • User
      • Ototal
      • State
    • Order Details Orderdetailinfo
      • Order
      • Goods
      • Count
      • Price
Working with pages
    • Organize existing pages and divide the contents of template and static directory
    • Find out the inheritance relationship of template pages
    • Replace data in a template


Python django-7 git and project

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.