读完这篇之后,我通过在 ~/.gitconfig 中添加以下几行,将 git 配置为使用 vimdiff 作为 diff/merge 工具:
[diff]
tool = vimdiff
[merge]
tool = vimdiff
[difftool]
prompt = false
[alias]
d = difftool
Run Code Online (Sandbox Code Playgroud)
但git difftool仍然只是打印差异(没有 vimdiff)。有任何想法吗?
更新。
似乎git difftool工作正常,如果我在 repo 中有一些未提交的更改,即它按预期打开 vimdiff。但是如果我git difftool在与冲突合并后打开 vimdiff,它就无法打开。任何想法为什么?
我正在尝试使用cmake构建我的项目,并且我在指定带有要链接的库的目录时遇到问题.
我的项目具有以下目录层次结构:
文件夹/ my_libs/libA/include
文件夹/ my_libs/libA/src
文件夹/ my_libs/libA/projects
文件夹/ my_libs/libA/unit_tests
folder/other_libs/devlib/include
文件夹/ other_libs/devlib/lib
3RD_PARTY_LIB/gtest-1.5.0/include
3RD_PARTY_LIB/gtest-1.5.0/lib
3RD_PARTY_LIB/pcre-8.02/include
3RD_PARTY_LIB/pcre-8.02/lib
3RD_PARTY_LIB 是环境变量,包含我使用的一些第三方库的路径.
问题出在unit_tests/CMakeLists.txt中 - 当我为include_directories指定包含它们的相对路径时,它们被正确处理,但是使用link_directories指定的相对路径处理错误.
这是我的makefile:
=================================
#folder/my_libs/libA/CMakeLists.txt
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project("libA")
add_subdirectory(src)
add_subdirectory(unit_tests)
Run Code Online (Sandbox Code Playgroud)
=================================
#folder/my_libs/libA/src/CMakeLists.txt
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project("libA")
set(HDR_LIST ../include/AuxRoutines.h
...
../include/utility.h)
set(SRC_LIST ModuleImpl.cpp
..
Version.cpp)
# add include dirs
include_directories("../include")
include_directories("../../../other_libs/devlib/include")
# disable some warnings
add_compile_options("/wd 4996")
...
# this command creates a new library from specified sources
add_library(libA STATIC ${SRC_LIST} ${HDR_LIST} )
Run Code Online (Sandbox Code Playgroud)
=================================
#folder/my_libs/libA/unit_tests/CMakeLists.txt
cmake_minimum_required(VERSION …Run Code Online (Sandbox Code Playgroud)