Github常用的功能分享(实时更新)

一、创建分支命令序列

其他可参考小弟的另外一个博客:https://blog.csdn.net/caip12999203000/article/details/126450842?spm=1001.2014.3001.5502

# 1、git进入命令行
# 2、初始化本地项目
git init
# 3、将所有文件加入本地仓库中
git add .
# 4、提交本地仓库
git commit -m "first commit" (""为要说明的内容)
# 5、关联本地仓库
git remote add origin ****.git (****.git为所建立的项目的地址)
例如 git remote add origin https://github.com/huangzhenhong520/test.git
# 6、创建分支
git branch -M xx (创建一个xx分支)
git push -u origin xx (把代码推送到远端仓库xx分支中)

二、Github默认分支切换(前提有两个分支以上)

参考网站

1.点击项目中的Settings

2.点击Code and automation中的Branches并点击切换按钮

3.切换自己想要的分支为默认主分支update即可

4.查看成果

三、git下载指定分支代码到本地

git clone -b 分支名 网址.git 
git clone -b v2.0 https://github.com/caip1299920300/Typora_markdown-.git

猜你喜欢

转载自blog.csdn.net/caip12999203000/article/details/128864639