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
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]
- Git and Github Basics for Every Developer
- 程式與網頁開發者必備技能!Git 和 GitHub 零基礎快速上手,輕鬆掌握版本控制的要訣!
- Git Tutorial: Learn How To Use Git in 23 Minutes!
[Reference]
- Git and Github Basics for Every Developer
成為作者繼續創作的動力吧!
從 Google News 追蹤更多 vocus 的最新精選內容 你可能也想看
發表回應
© 2024 vocus All rights reserved.