How to Use Git and GitHub

Lesson1

Finding Diffs Between Larger Files

这个课程让我学会用命令行自动比较两个文件的不同
下载材料两个javascript文件:
game_old.js
game_new.js
打开命令行cmd,输入cd downloards进入存放上述两文件的路径
然后输入FC game_old.js game_new.js (FC = file compare)
回车,显示结果

这里写图片描述

Reflect: Using diff to Find Bugs

Choose Sublime as a text editor
Make sure you can launch your editor from the command line
Windows
方法:
Find the directory where Sublime is located for you. For many people, this is C:/Program\ Files/Sublime\ Text\ 2/sublime_text.exe. To test this, run ls C:/Program\ Files/Sublime\ Text\ 2 within Git Bash. You should see sublime_text.exe listed. If you get the error No such file or directory, Sublime is located somewhere else for you and you’ll need to find it. For example, it might be under C:/Program\ Files\ (x86)`.

Run the following command in Git Bash: echo ‘alias subl=”C:/Program\ Files/Sublime\ Text\ 2/sublime_text.exe”’ >> ~/.bashrc If Sublime was in a different directory for you in step 1, use that directory.

Close and re-open Git Bash.

Type subl in Git Bash. If Sublime opens no further steps are required. If Sublime does not open continue with steps 5 - 7.

Test .bashrc by running the command source ~/.bashrc in Git Bash and retry typing subl to start sublime. If Sublime doesn’t start check the contents of the file ~/.bashrc created in step 2.

To ensure the .bashrc file contents is loaded each time you open Git Bash, edit ~/.bash_profile and add the following two lines. (Reference)

if [ -r ~/.profile ]; then . ~/.profile; fi

case “$-” in i) if [ -r ~/.bashrc ]; then . ~/.bashrc; fi;; esac

Close and re-open Git Bash. Type subl in Git Bash to check it starts correctly.

Set up your course workspace
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值