git上传文件到服务器
时间: 2023-08-27 20:06:03 浏览: 129
要将文件上传到git服务器,可以按照以下步骤进行操作:
1. 首先,在本地创建一个新的文件夹,并在该文件夹中打开Git Bash命令控制台。如果没有安装Git软件,需要先安装Git软件,可以从https://git-scm.com/ 下载并安装。
2. 使用命令行工具进入到你的本地仓库目录。
3. 添加远程仓库的链接。使用命令`git remote add new_repo_name git@192.168.43.64:/home/git/platform/src/repo.git`,其中new_repo_name是你给远程仓库自定义的名字,git@192.168.43.64:/home/git/platform/src/repo.git是远程仓库的URL地址。
4. 可以使用命令`git remote -v`来查看刚才设置的远程仓库(可省略)。
5. 使用命令`git push new_repo_name branch_name`将分支上传到远程仓库。例如,使用命令`git push origin master`将本地的master分支上传到远程仓库。
这样,你的文件就会被上传到git服务器上了。你可以通过访问你的git网页来查看上传的文件,网页地址为https://xxx.github.io/+你的文件名/+你要访问的html页。完成后,你可以分享你的网页了。
#### 引用[.reference_title]
- *1* [git软件 手把手教你如何上传文件到git服务器](https://blog.csdn.net/weixin_42733707/article/details/100049549)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* *3* [Git仓库上传服务器](https://blog.csdn.net/qq_27809619/article/details/127092123)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文
相关推荐

















