# Git文件上传


1.输入 `git init` ，初始化，在本地创建一个Git仓库;  
2.输入 `git add` . 将项目添加到暂存区;  
3.输入 `git commit -m &#34;注释内容&#34;` 将项目提交到Git仓库;  
4.输入 `git branch -M main` ，上传到 main 分支;  
5.输入 `git remote add origin https://github.com/xxxxx/test.git`，和远程仓库连接;  
6.输入 `git push -u origin main` 将本地项目推送到远程仓库.


---

> 作者: [LJL](https://nianhhhh.github.io/)  
> URL: http://localhost:1313/posts/b3906ec/  

