下载项目 git clone HTTPS
$ git clone https://github.com/ywcmoon/CNCompanyReviews.git
Cloning into 'CNCompanyReviews'...
remote: Enumerating objects: 141, done.
remote: Counting objects: 100% (141/141), done.
remote: Compressing objects: 100% (136/136), done.
remote: Total 141 (delta 73), reused 5 (delta 2), pack-reused 0
Receiving objects: 100% (141/141), 126.70 KiB | 208.00 KiB/s, done.
Resolving deltas: 100% (73/73), done.
查看状态 git clone status
$ git status
On branch main
Your branch is up to date with 'origin/main'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: "\351\225\277\346\262\231.md"
no changes added to commit (use "git add" and/or "git commit -a")
添加暂存区 git add .
提交到本地的版本控制库 git commit -m "备注说明"
$ git commit -m "111"
[main d208da3] 111
1 file changed, 1 insertion(+), 1 deletion(-)
本地项目关联远程项目 git remote add origin HTTPS
$ git remote add origin https://github.com/ywcmoon/CNCompanyReviews.git
提交项目到github仓库git push origin main (默认仓库名master已更新为main)
$ git push origin main
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 280 bytes | 280.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
To https://github.com/ywcmoon/CNCompanyReviews.git
122631c..d208da3 main -> main
其它
查看配置信息
git config --list
查看用户名,邮箱配置
git config user.name
git config user.email
全局配置用户名,邮箱
git config --global user.name "用户名"
git config --global user.email "邮箱"
|