使用
macOS arm64
透過 brew 安裝 difftastic
brew install difftastic
確認能用
difft --version
輸出應包含「Difftastic 0.72.0」。
先試試這個
cat > /tmp/foo1.c <<'EOF'
int main() {
int x = 1;
return x;
}
EOF
cat > /tmp/foo2.c <<'EOF'
int main() {
int x = 2;
return x;
}
EOF
cat > /tmp/before.js <<'EOF'
function add(a, b) { return a + b; }
EOF
cat > /tmp/after.js <<'EOF'
function add(a, b) {
return a + b;
}
EOF
cat > /tmp/after_changed.js <<'EOF'
function add(a, b) {
return a - b;
}
EOF
cat > /tmp/file_with_conflicts.js <<'EOF'
<<<<<<< HEAD
function foo() { return 1; }
=======
function foo() { return 2; }
>>>>>>> branch
EOF
cat > /tmp/reformat_before.js <<'EOF'
function greet(name) { console.log("hello " + name); }
EOF
cat > /tmp/reformat_after.js <<'EOF'
function greet(name) {
console.log("hello " + name);
}
EOF
cat > /tmp/reformat_after_changed.js <<'EOF'
function greet(name) {
console.log("hi " + name);
}
EOF
echo setup_done
ls -l /tmp/foo1.c /tmp/before.js /tmp/file_with_conflicts.js
difft /tmp/foo1.c /tmp/foo2.c它能做什麼
- 依語法比較檔案已測試
- 在上下文中突顯變更的語法片段已測試
- 忽略重新格式化、僅顯示實際變更已測試
- 檢查檔案是否具有相同語法樹已測試
pickfit 測到哪一步
macOS arm64
- 可以安裝
- 可以啟動
- 4 項功能中 4 項可用
- 可離線使用
適合用來
可替代 diff 和 mergiraf。