個人資料
歸檔
正文

Git,Github/Gitlab,PyCharm VCS,VS code

(2022-09-01 11:49:34) 下一個

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。

 

[ 打印 ]
閱讀 ()評論 (0)
評論
目前還沒有任何評論
登錄後才可評論.