Git基本操作命令使用

Git基本操作命令使用

1、在当前目录新建一个git代码库

$ git init

2、添加当前目录的所有文件到暂存区

$ git add .

3、提交暂存区到仓库区

$ git commit -m "提交信息"

4、将本地代码与远程代码仓库相关联

$ git remote add origin 项目地址(https://gitee.com/*)

5、强制把远程仓库的代码更新到当前分支上面(如果远程仓库为空则可省略)

$ git pull --rebase origin master

6、将本地代码提交到指定的远程仓库中

$ git push -u origin master
posted @ 2021-06-03 23:09  Jacksonliao  阅读(48)  评论(0)    收藏  举报