Git,Github/Gitlab,PyCharm VCS,VS code

打印 被阅读次数
1.Github

https://www.liaoxuefeng.com/wiki/896043488029600 是一个很好的教程,官网https://git-scm.com/book/en/v2,英文有https://www.tutorialspoint.com/git/index.htm

要把本地内容推往github,需要git账号和口令。但是自2021.8以来,口令不是你存在git网站的ssh key,而是personal token的内容,按此创建:https://dev.to/ibmdeveloper/can-t-push-to-your-github-repo-i-can-help-with-that-1fda。新建的token要点击旁边的按钮拷贝自己另存,不然以后只能看见token的名字就没法用了。


版本更新:sudo add-apt-repository ppa:git-core/ppa -y

sudo apt-get update

sudo apt-get install git -y

git --version

#with --no-ff, merge can add comments


$ git checkout master

$ git merge --no-ff feature       

It will open up the following in your git’s default text editor:

Merge branch 'features'

# Please enter a commit message to explain why this merge is necessary,


# especially if it merges an updated upstream into a topic branch.

#

# Lines starting with '#' will be ignored, and an empty message aborts

# the commit.

Modify the comments. In this case, you can just add “C4: ” before “Merge branch ‘features’”. The output should look like this:


Merge made by the 'recursive' strategy.

b.txt | 0

c.txt | 0

d.txt | 0

3 files changed, 0 insertions(+), 0 deletions(-)


create mode 100644 b.txt

create mode 100644 c.txt

create mode 100644 d.txt

Now if you check the history, it should look like the following:

$ git log --oneline


e071527 C4: Merge branch 'features'

bb79c25 C3: Adding d.txt

692bd8c C2: Adding c.txt

a0df62a C1: Adding b.txt

7575971 C0: Adding a.txt


Mnemonics:

Tilde ~ is almost linear in appearance and wants to go backward in a straight line

Caret ^ suggests an interesting segment of a tree or a fork in the road

G   H   I   J

  /      /


  D   E   F

     |  /

    | /   |

     |/    |

      B     C


          /

        /

         A

A =      = A^0

B = A^   = A^1     = A~1            #A^=1st parent B, A~1=back one generation


C = A^2                                       #A^2 means 2nd parent

D = A^^  = A^1^1   = A~2        #D is A's 1st grandparent and back two gen

E = B^2  = A^^2

F = B^3  = A^^3

G = A^^^ = A^1^1^1 = A~3


H = D^2  = B^^2    = A^^^2  = A~2^2

I = F^   = B^3^    = A^^3^

J = F^2  = B^3^2   = A^^3^2

2. VS Code (editor)

下载https://code.visualstudio.com/download 安装直接用dpkg -i ,运行code 。


教程:https://code.visualstudio.com/docs/getstarted/introvideos?  中文:https://vscode.cool/ https://github.com/tsq/vscode-course

2.1 VS code用于ESP32

W10装VS code,点左侧extension图标装esp-idf,然后View|Command Palette键入Configure ESP-IDF选Advanced,下载并安装。View|Command Palette选show examples projects,中窗点击blink,右窗点击Create project using example blink,选上一级目录即get-start,这样相关文件会在blink目录下,忽略此步错误。按ctrl-E然后B编译,ctrl-E S看尺寸,Ctrl-P设置编程串口,Ctrl-E F烧入https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/tutorial/basic_use.md? 按F1再输入ESP-IDF: Set Espressif device target可设板子。

https://www.youtube.com/watch?v=r50BKIFGCI0?  https://www.youtube.com/watch?v=hMfi_ONvGEs https://www.youtube.com/watch?v=iJKIxrJ40ss

3. PyCharm VCS (V2022.2.1)


PyCharm In-Depth VCS #1: Getting Started https://www.youtube.com/watch?v=_w9XWHDSSa4 https://www.youtube.com/watch?v=AHkiCKG-JhM

https://www.jetbrains.com/help/pycharm/version-control-integration.html

3.1 Local History

内置版本控制,点击源码窗再选File|Local History|Show history或右击一段选中的源码再选Local History。View|Recent changes,选某revision在右击可选Revert。选Local History|Put Label可增加tag,鼠标停在revision上时会显示该tag。

登录后才可评论.