远程推送github仓库的基础操作

github 基础操作


在此之前,需要安装好Git,且配置成功并创建了远程仓库

向远程仓库推送本地项目

首先,找到你要放到远程仓库的项目,右键git bash

在 README.md 加入说明:# labmanage

echo "# labmanage" >> README.md

初始化本地仓库

git init

提出更改(把它们添加到暂存区),使用如下命令:

git add README.md
git add *

使用如下命令以实际提交改动

git commit -m "first commit"

创建新分支(不确定是不是)

git branch -M main

添加远程地址

git remote add origin https://github.com/yourName/yourRepo.git

将这些改动提交到远端仓库

git push -u origin main 

所有代码的集合如下:

echo "# labmanage" >> README.md
git init
git add README.md
git add *
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/yourName/yourRepo.git
git push -u origin main              

猜你喜欢

转载自blog.csdn.net/weixin_43520670/article/details/111657417
今日推荐