The Data Scientist’s Toolbox

command line interface(CLI)常用命令:

格式:command flags arguments

1. pwd  : displays the path to the current working directory

例:

TaomatoMacBook-Air:~ Mars$ pwd

/Users/Mars

2. clear :clear out the commands in your current cli window

3. ls :lists files and folders in the current directory

4. ls -a :lists hidden and unhidden files and folers

5. ls -al :lists details for hidden and unhidden files and folders

6. cd :stands for "change directory"

7. cd .. :allows you to change directory to one level above your current directory

8. mkdir : stands for "make directory"

9. touch : creates an empty file

例:touch test_file

10. cp:stands for "copy" cp 有两个参数,第一个参数代表要复制的文件,第二个参数代表要把复制的路径

例:cp test_file Documents

11. cp -r Documents More_docs 带有-r的cp可以复制路径中的内容到其他路径

12. rm :stands for "remove"

13. rm -r More_docs:代表可以移除整个路径和他里面的内容

注意:使用rm -r一定要小心

14. mv :stands for "move"

例:mv new_file Documents

15.使用mv可以重命名文件

例:mv new_file renamed_file


git常用命令

1. 创建版本库的两种方法:

(1)git clone url #克隆远程版本库github

(2)git init #初始化本地版本库

2.修改和提交

  • git status #查看状态
  • git diff      #查看更改的内容
  • git add .  #跟踪所有该动过的文件
  • git add <filename> #跟踪指定的文件
  • git mv <old> <new> #文件改名 注意:这个跟CLI命令一样
  • git rm <filename> #删除文件  CLI命令
  • git rm --cached <filename> #停止跟踪文件但不删除
  • git commit -m " message" #提交所有跟踪的文件
3.查看提交历史

git log

4.撤销

git checkout HEAD <filename> #撤销指定的未提交文件的修改内容

5.分支

git branch #显示所有本地分支

git checkout <branch> #切换到指定分支

git branch <new branch> #创建新分支

git branch -d <branch> #删除本地分支

6.合并

git merge <branch> #合并指定分支到当前分支

7.远程操作

  • git remote -v #查看远程版本库信息
  • git remote add <remote> <url> #添加远程版本库
  • git pull <remote> <url> #下载并快速合并
  • git push <remote> <branch> #上传并快速合并

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值