GIT Learning Notes

Published 2026-08-18 16:13 170 words 1 min read

Basic Git learning notes

GIT Learning

Linking Github

  1. Type git init in the project directory: initializes the current directory as a local git repository
  2. Type git status in the project terminal: observes the repository’s branch status, untracked files, and commit history
  3. Type git add . in the project terminal: adds all changed files in the current directory to the staging area
  4. Type git commit -m "init commit" in the project terminal: commits the staged files to the local repository, creating the first commit record
  5. Type git remote add origin 远端仓库地址 in the project terminal: links the local repository to the remote repository, setting the remote repository alias to origin
  6. Type git branch -M main in the project terminal: renames the local default branch to main, matching the mainstream branch names used by GitHub/Gitee
  7. Type git push -u origin main in the project terminal: pushes the local main branch to the remote origin repository and sets up the upstream tracking relationship

If you enjoyed this, leave a comment~

... Page views
© 2021 - 2026 Vullfin @VV
Powered by theme astro-koharu · Inspired by Shoka