2024-06-05|閱讀時間 ‧ 約 26 分鐘

Git

    1. Outline

    Takeaway

    • Setting up Git and verifying installation
    • Configuring your Git username and email
    • Initializing a new Git repository
    • Staging and committing changes
    • Creating a Github Repository
    • Creating New Git Branches
    • Connecting your local repository to GitHub using SSH
    • Pushing your project to a remote repository

    My Note

    • check the version: git --version
    • get a repository of your project: git init -b main
    • staging, put the project file above into this main branch: git add .
    • commit the changes: git commit -m "init"
    • ssh key: ls -al ~/ .ssh
    • go to GitHub docs and search "SSH key" - Generating a new SSH key
    • copy the file pbcopy .ssh/id_ed25519.pub < ~/
    • create SSH key - go to settings - Access - SSH key
    • push to GitHub: git push -u origin main
    • git add -A
    • git commit -m "message"
    • git push origin main

    2. Outline

    Takeaway

    • 00:00 開場白 & Git 安裝
    • 02:03 Git 基本設定與初始化
    • 03:36 Git 檔案狀態
    • 06:46 檢視提交記錄與檔案還原
    • 10:06 忽略檔案清單
    • 10:34 GitHub 註冊 & 同步儲存庫
    • 12:11 加入協作者至專案
    • 13:36 建立分支
    • 14:35 發起合併請求 & 合併分支

    My Note

    • Mac install git: xcode-select --install
    • check git version: git --version
    • set username and email: git config --global user.name "LauraHsu", git config --global user.email "weilunhsu.roc@gmail.com"
    • initialize: git init
    • check the status: git status
    • Status to know:tracked追蹤, untracked未追蹤, staged已暫存, committed已提交
    • tracked to untracked: git add .
    • green word means ready
    • commit: git commit -m
    • add all the file which is md: git add *.md
    • all the catalog: git log, q(to exit)
    • git online: git log --oneline
    • compare the version difference: git diff
    • confirm to change: git checkout
    • resume: git reset --hard
    • connect local to remote: git remote add origin (website)
    • branch: git branch -M main
    • push: git push
    • clone: git clone
    • change directory: cd
    • pulll: git pull
    • branch: git branch
    • checkout: git checkout

    3. Outline

    Takeaway


    [Reference]

    1. Git and Github Basics for Every Developer
    2. 程式與網頁開發者必備技能!Git 和 GitHub 零基礎快速上手,輕鬆掌握版本控制的要訣!
    3. Git Tutorial: Learn How To Use Git in 23 Minutes!









    [Reference]

    1. Git and Github Basics for Every Developer
    分享至
    成為作者繼續創作的動力吧!
    © 2024 vocus All rights reserved.