Git使用---------

command line

ls

cd

mkdir new -------新建文件夹

touch ch1.txt -------新建一个文档

open -a /A........ .app ch1.txt --------在...打开ch1.txt (tab补齐)

-a ------所有

version control

-------回到之前的某个save point by git

local repositoris

先cd你的dir

git init
git status // no commit yet
git add ch1.txt   //in the stage area and ready to be commited
git add .  //将所有该dir的加进去
git commit -m "complete ch1"  //加入git repo
git checkout ch1.txt  //roll back to previous version

github

将local repo传到github

git remote add origin https://github.com/wyachen/Story.git 
git push -u origin main

 

clone

在这里切换branch 

复制这个链接 

 

在本地文件夹中打开bash terminal 

输入

git clone <link>

branch 

git branch <name>  //创建新的branch
git checkout <name>   //switch to that branch
git branch  //查看正处于哪个branch

加完新的branch, 切换到branch, 修改, add, commit

- merge

git merge <name>

之后在 git push放入github

fork to own remote repository ------> clone to local ------> commit  ------->push to own remote repo------> pull request ---->merge

cd--->写 ------> git init ------> git add . ----->git commit -m "" ------>git remote -----> git push

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值