day02 study notes

day02

  1. Today learning content
    • Operation and use of the cloud code
    • The use and operation git

Yesterday Recap

  1. Composition of the computer
    • cpu, hard drives, memory, graphics, and other input and output devices. Related expand courses: Principles of Computer Organization
  2. Programming Language Introduction
    • Compiled language features: one-time compiler, you have entered all the code into fairly uniform translation
    • Interpreted languages ​​Features: Write a sentence translated word, equivalent to English simultaneous interpretation
    • Related to expand the curriculum: the compiler principles
  3. python installation
    • Official website: python.org
  4. pycharm installation
    • Note that after installing the required configuration file
  5. Collaboration between hardware-dependent operating system
    • Recommended related courses: computer operating system
  6. From the keyboard of the computer in the interior of a process
    • Related courses: Computers Work
  7. My first py file
    • Finally affix into py with a win in the computer system writes the code (text document txt file) to create a text. Programming python can identify files.
  8. File name extension
    • In the win system, view the hidden files
  9. Environment Variables
    • In the win system, change the python environment variable with the command to open, ensure that the installation is correct.

Today learning content

  1. Version control tools (code cloud)
  2. git plugin

Use code and operational cloud site

  1. (Code cloud) Description: We are using Baidu network disk Bar, Baidu network disk is not that we are a remote repository. Store some novels, audio files of what we learn is a remote code cloud management repository, similar to Baidu network disk. We now want to upload some content is not how to upload click directly upload it from Baidu network disk, but also directly download click to download, but we have now entered the programmers on the road, we will upload and download time with One way to B's installed, that is, to use git tool.
  2. Cloud code official website: gitee.com
  • Account Number: Yao Liang / password do not say
  • Personal space Address: http: //gitee.com/qiangjiaowodabai
  • Registration runs
  • Fill in content

  1. git description:
  2. git commonly used commands:
  • git init     创建一个本地仓库
    
    git add .     添加  当前文件夹下所有内容  到暂存区
    
    git add test.txt     指定文件夹内的文件进行添加
    
    git commit -m "第一次提交"     引号内是提交后文件显示的名称
    
    git remote add origin (复制链接)  建立本地仓库与码云远程的链接
    
    git push -u origin master     将本地仓库中添加的内容上传到远程仓库
    
    git pull origin master --allow-unrelated-histories  从远程仓库强拉回本地仓库

git: For initial use

  1. The first step: first-time need to configure Global

      1. Operation Command
    • git config --golbel user.nema '你的用户名'
      git config --golbel user.email '邮箱'
  2. Step two: git local repository initialization

    After installing git, you need to go to the directory to store the code that initializes (If you create a directory again, you need to re-initialize)

    • Initialization Commands

    • git init
    • After initialization is complete, it will generate in the current path to a .git directory (mac os query command) mac os query hidden files (la -a)

      ls -a
      .git  今日作业.py
  3. The third step: submit code to a local warehouse

    • Submit order

    • git add .   表示匹配当前代码路径下所有内容
      
  4. Step four: to inform the content of the information submitted by local repository

    • After the contents of the code paths submitted to the local repository, we need to inform the content of the information submitted to the local warehouse

    • Operation Command

      git commit -m ‘提交的内容信息’
  5. Step five: to establish a link with the remote warehouse

    • After the submission of documents under the code directory to a local warehouse, the need to establish a link with the remote repository which will be submitted contents of the local repository to the remote repository.

    • Operation Command

    • git remote add origin 远程仓库地址
  6. Step Six: local code repository push the files to a remote repository

    • Operation Command

    • git push -u origin master     依次输入账号和密码

git non-first use

  1. The first step: submit code to a local warehouse

    • After initialization git repository, under the code directory content needs to be submitted to the local repository

    • Operation Command

    • git add .   表示匹配当前代码路径下所有内容
  2. The second step: to inform the content of the information submitted by local repository

    • After the contents of the code paths submitted to the local repository, we need to tell submission of information to the local warehouse.

    • Operation Command

    • git commit -m '提交的信息内容'
  3. The third step: the local code repository push the files to a remote repository

    • After establishing a link with the remote repository, we need to a local warehouse push the files to a remote repository

    • git push -u origin master 一次输入账号和密码

About git pull Code conflicts

  1. Comply with the principles
  • The code does not delete the remote repository
  • To delete the code, you can only delete the local

If you mistakenly delete a remote file repository lead to code-conflict recovery demo

  1. Solution:

      1. First pull the code
    • git pull origin master

      After entering the command to pull the code will be prompted as follows, meaning (Please enter a commit message to explain why the merger) where you can choose not to enter

      1. Plus options --allow-unrelated-histories (allows you to merge unrelated history) once again pulled
    • git pull origin master --allow-unrelated-histories
      1. They can submit code again, not being given

    ⚠️ as it has been deleted in the remote repository directory, so the local directory will be deleted after submission.

    ⚠️ Therefore, do not delete files in the remote repository! ! !

Guess you like

Origin www.cnblogs.com/qingjiaowodabai/p/11460533.html