git 将本地项目添加到远程仓库

第一步
在本地新建一个目录(比如:git-test),进入目录,右键执行 Git Bash Git

在这里插入图片描述
第二步
执行 git init
在这里插入图片描述
此时目录下会多一个.git的文件夹
在这里插入图片描述

第三步
在目录中新建一个文件比如:txt.txt
在这里插入图片描述

然后运行

git add .

git add是 添加文件到仓库

git commit -m "添加代码"

git commit 是 提交暂存区到本地仓库。

第四步 将本地暂存区上传到到远程仓库

在这里插入图片描述

 git remote add origin https://gitee.com/****/test-git.git   /// https://gitee.com/****/test-git.git git 仓库地址

git remote add origin 将本地暂存区上传到到远程仓库

然后到仓库地址查看是否上传成功。成功如下
在这里插入图片描述

操作完成…


扩展

简易的命令行入门教程:
Git 全局设置:

git config --global user.name “****”
git config --global user.email " ***"

创建 git 仓库:

mkdir test-git
cd test-git
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://gitee.com/****/test-git.git
git push -u origin master

已有仓库?

cd git-dir
git remote add origin https://gitee.com/****/test-git.git
git push -u origin master

猜你喜欢

转载自blog.csdn.net/super__code/article/details/103781082