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