git 以及 github 使用系列

时间:2023-03-09 15:28:07
git 以及 github 使用系列

本人打算开始写一个有关git 使用,以及github 使用的系列文章了,一来可以自己总结,二来github用好了,可以存放自己的一些知识框架吧。

1.准备 : 有一个 github上的账号, windows 10 的操作系统, win10上安装 git 。

2.

  mkdir pork_dbobject

  git init

拷贝一些文件到pork_dbobject 这个目录下面

  git add ./*

  git commit -m 'add pork_dbobject'

  ( git push ) git remote add origin https://github.com/flyysr/pork_dbobject.git

这时,要在github网站上创建 pork_dbobject repository 这个仓库。

  ( git push origin ) git push --set-upstream origin master

git 以及 github 使用系列

这样,就把本地创建的一个git 仓库更新到了github 上面,就可以在github上来管理自己的项目了,在新的地方,只要 git pull 就可以从github上面吧这个 repository

拉取下来了。很方便吧。:-)

其实在github 上面创建一个新的 repository 后,会出现这样一个页面提示,告诉你怎么去将代码加入到这个仓库里面。

git 以及 github 使用系列