git创建远程项目并进行代码管理及相关命令

1.windows下载Git     https://git-scm.com/downloads

然后一路点击安装

2.登录github,点击右上角创建仓库

3.在本地项目根目录下 输入如下命令

ssh-keygen -t rsa -C "2020956572@qq.com"             #本地生成.ssh文件,提示输入 默认路径,然后输入密码,确认密码

在github上进入后,

添加公钥,这样才能提交代码成功

接着输入如下命令即可

git init

git add *

git commit -m 'first commit'

git remote add origin https://github.com/YouGitName/djan.git

git push -u origin master

其他命令

git rm -rf file   # 删除文件或文件夹

git clone ****.git #拉取远程项目到本地

git branch #查看所有分支,及当前分支

git checkout master #切换到master分支

git checkout -b hhhh master  #拉取远程分支并创建本地分支

git merge dev #把dev分支的代码合并到本分支

git pull origin master #把远程master分支拉取到本地

git log #查看日志

git reset --hard #强行把版本更新到最新版本,然后 执行 git pull

git --help #查询帮助信息

 

其他git的使用,包括 git commit 规范,工作流,windows系统的使用及工具Vscode的使用等,请查看下载如下链接;

https://github.com/Rgcsh/Knowledge/tree/master/other_file 里的git_use.xlsx 文件

 

转载于:https://www.cnblogs.com/rgcLOVEyaya/p/RGC_LOVE_YAYA_810days_1.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值