GIT Learning
Linking Github
- Type
git initin the project directory: initializes the current directory as a local git repository - Type
git statusin the project terminal: observes the repository’s branch status, untracked files, and commit history - Type
git add .in the project terminal: adds all changed files in the current directory to the staging area - Type
git commit -m "init commit"in the project terminal: commits the staged files to the local repository, creating the first commit record - Type
git remote add origin 远端仓库地址in the project terminal: links the local repository to the remote repository, setting the remote repository alias to origin - Type
git branch -M mainin the project terminal: renames the local default branch to main, matching the mainstream branch names used by GitHub/Gitee - Type
git push -u origin mainin 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~