Code into self-cultivation of agricultural skills necessary study notes

Code into self-cultivation of agricultural skills necessary study notes

Basic Koichi ---- typing

As a qualified farm code, the code word speed certainly can not sell, fingers have to be able to keep up with the speed of our thinking.

Based on this, a qualified farm yard, fundamental research, but also a fast typist

To this trained "one finger" the effort, we usually can also be more knock recommended here typing practice a foreign website - TypingClub , speed may be a bit slow, qualified students can get at, right.

---- two basic skills of language proficiency in an IDE

We often see the big foreign gods were powerful coding .vim course with vim and even the windows built-in notepad, but for some of our large-scale development projects, either can not meet our needs, as encoded using notepad, personal feeling is a value gimmick.

Therefore, as a person proficient in a language, we need to know or even proficient in the use of an IDE.

I'm taking the java direction, and therefore the most important IDEA.IDEA function is very powerful. We can install some plug-ins on the basis that this rich functionality to meet the needs of the development environment of our complex

With the integrated development environment, we also need to have a small editor --- VsCode.VSCode is Microsoft's development of a family of lightweight development tool. Small but perfectly formed, vscode support for each language is released by developer plug expansion pack to achieve.

Some common VsCode shortcuts:

  • ctrl + O / K opening-closing folder
  • Ctrl + F Close the workspace
  • Ctrl + N / W / S new file / Close File / Save File
  • Ctrl + F search
  • Ctrl + H to replace

---- vim three basic skills

The students are familiar with Linux is not new to vim, vim is usually pre-installed Linux distribution will be a text editor, the editor of one of the originator of the series

vim There are three forms we have to figure out in the course:

  1. Command Mode

    vim is open when the command mode. In this mode keyboard actions will be identified as a command rather than a character

  2. Input Mode

    In command mode by ientering input mode, press ESCto exit the input mode

  3. Bottom line command mode

    In command mode, by :entering the bottom line command mode, for example, you want to exit the edited file, press ESCReturn to command mode, then press wqto save and exit

Vim commonly used commands:

  1. delete

    • x / X to delete a character backward or forward
    • nx back to delete several characters in a row
    • dd delete an entire row
  2. copy and paste

    • Copy the line yy
    • p / P Copy and paste the contents of the next line of the cursor line or the previous line
    • nyy copies n rows
  3. Undo / Redo

    • u withdrawal
    • Ctrl + r Redo
  4. search for

    In the bottom line command:

    • / Content to the content matches the string after the cursor
    • ? String to match the contents of the cursor
    • Continue down the string matching n
    • N reverse match

---- four basic regular expressions

Regular expressions are used to match strings, replace text strings etc. and extract the barriers to entry are relatively high, if skilled, will be your development work is a great tool

---- five basic Git version control tools

We have the appropriate code development tools, with the coding speed of flying in general, but we have a little something -Git

Git is quite important, it is the world's most advanced distributed version control system, but also a skill of the program will be.

Basic use

git inin #初始化一个本地版本库
git status # 查看工作区状态
git add 文件 #将文件加入工作目录
git log #查看日志
git push #将本地文件推送到远程仓库
git pull # 将远程的分支拉取到本地并进行合并操作
git clone # 克隆远程的某个分支
git merge #合并分支
git fetch # 将远程分支拉取到本地但是不进行合并

A job

  1. The remote repository to pull local
D:\se2020
λ git clone https://github.com/zh2333/AdvancedSoftWare.git
Cloning into 'AdvancedSoftWare'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
  1. New Devbranch
D:\se2020\AdvancedSoftWare (master -> origin)
λ ls
README.md

D:\se2020\AdvancedSoftWare (master -> origin)
λ git checkout -b dev
Switched to a new branch 'dev'
  1. Edited on README.md

    Modify content A B C

D:\se2020\AdvancedSoftWare (dev -> origin)
λ vim README.md

D:\se2020\AdvancedSoftWare (dev -> origin)
λ git log
commit bea0eea35f17ec6795bd952442613fbcddf13808 (HEAD -> dev, origin/master, origin/HEAD, master) Author: zh2333 <[email protected]>
Date:   Sun Mar 29 17:18:03 2020 +0800

    Initial commit
  1. The same file is modified in this remote

    Modify contentA B D

  2. Switch back to the local master branch, pull

    Error, prompt us to submit modifications

    D:\se2020\AdvancedSoftWare (master -> origin)
    λ git pull
    remote: Enumerating objects: 5, done.
    remote: Counting objects: 100% (5/5), done.
    remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
    Unpacking objects: 100% (3/3), done.
    From https://github.com/zh2333/AdvancedSoftWare
       bea0eea..6cbb221  master     -> origin/master
    error: Your local changes to the following files would be overwritten by merge:
            README.md
    Please commit your changes or stash them before you merge.
    Aborting
    Updating bea0eea..6cbb221
    

    Commit changes, and then pull

    D:\se2020\AdvancedSoftWare (dev -> origin)
    λ git checkout master
    Switched to branch 'master'
    Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
      (use "git pull" to update your local branch)
    
    D:\se2020\AdvancedSoftWare (master -> origin)
    λ git pull
    Updating bea0eea..6cbb221
    Fast-forward
     README.md | 5 ++++-
     1 file changed, 4 insertions(+), 1 deletion(-)
    

    pull Success

  3. Merge changes

    Switch back to dev branch

    D:\se2020\AdvancedSoftWare (dev -> origin)
    λ git checkout dev
    Already on 'dev'
    
    D:\se2020\AdvancedSoftWare (dev -> origin)
    λ git rebase -i master
    Auto-merging README.md
    CONFLICT (content): Merge conflict in README.md
    error: could not apply e0b4872... change from local
    Resolve all conflicts manually, mark them as resolved with
    "git add/rm <conflicted_files>", then run "git rebase --continue".
    You can instead skip this commit: run "git rebase --skip".
    To abort and get back to the state before "git rebase", run "git rebase --abort".
    Could not apply e0b4872... change from local again
    

    Prompt an error, inconsistent file, you need to modify the conflict, and then submit

    Re-open the file, find git had marked the place of conflict for us

    # AdvancedSoftWare
    A
    B
    <<<<<<< HEAD
    D
    =======
    C
    
    >>>>>>> e0b4872... change from local
    ~
    

    After the conflict changes, resubmit

    D:\se2020\AdvancedSoftWare (HEAD detached at 6cbb221 -> origin)
    λ git add *
    
    D:\se2020\AdvancedSoftWare (HEAD detached at 6cbb221 -> origin)
    λ git rebase --continue
    [detached HEAD f8f6771] change from local last time!
     1 file changed, 4 insertions(+)
    Successfully rebased and updated refs/heads/dev.
    

    Back to the master branch, merge Dev branch

    D:\se2020\AdvancedSoftWare (dev -> origin)
    λ git checkout master
    Switched to branch 'master'
    Your branch is up to date with 'origin/master'.
    
    D:\se2020\AdvancedSoftWare (master -> origin)
    λ git merge dev
    Updating 6cbb221..f8f6771
    Fast-forward
     README.md | 4 ++++
     1 file changed, 4 insertions(+)
    

    The combined success!

  4. Remote pushed back

D:\se2020\AdvancedSoftWare (master -> origin)
λ git push
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 325 bytes | 325.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/zh2333/AdvancedSoftWare.git
   6cbb221..f8f6771  master -> master

We're done!

Guess you like

Origin www.cnblogs.com/sa19225475/p/12593755.html