git-diff

How can I use GitHub's online compare view to show the difference of “just the file contents” of two branches?

爱⌒轻易说出口 提交于 2021-02-19 02:41:49
问题 I want to compare "just the file contents" of two branches of a GitHub repository. When I use the default compare view for a pull request for example, it does still show me some diffs, even though the files are identical. You can reproduce the situation like this: Create new repository on GitHub with a file README . Add text to README and push the commit to a new branch duplicate . Add the same text to README of the master branch. Both README files from both branches now have identical

`git diff -w` (or `--ignore-all-space`) is broken

ⅰ亾dé卋堺 提交于 2021-02-19 02:34:06
问题 According to the official git docs: git diff -w, --ignore-all-space Ignore whitespace when comparing lines. This ignores differences even if one line has whitespace where the other line has none. However, a basic test shows that this is not really true. Reproduction steps: Create somefile.txt with the following contents: Line 1: Any text you want Line 2: Any non-zero number of spaces Line 3: Any text you want git add somefile.txt cp somefile.txt somefile.orig.txt Modify somefile.txt : Line 1:

Git find modified files since <ref> from a shallow clone

我的未来我决定 提交于 2021-02-16 14:10:26
问题 I'm on a CI box running tests. To speed it up, I'm just doing a shallow clone: git clone --depth 1 git@github.com:JoshCheek/some_repo.git Assuming all the tests pass, I want to trigger the next step in the pipeline. What to trigger is based on which files changed between the last d eployment (ref d123456 ) and the c urrent ref I just tested (ref c123456 ). If I had done a normal clone, I could find out like this this: git diff --name-only d123456 c123456 But my clone is shallow, so it doesn't

Using R, how to get the “diff” of two strings?

*爱你&永不变心* 提交于 2021-02-11 13:10:47
问题 The base R function diff computes a first difference, useful for lagged data comparisons. I am looking for the GNU diff function accessible in R: https://www.computerhope.com/unix/udiff.htm This function is useful for version control, but also useful in natural language processes to identify changes or edits between two similar text elements. This is also an underlying engine of git and so on. Ideally the function would be gnudiff(text1,text2) and if tied to quanteda or another library, that

Using R, how to get the “diff” of two strings?

痴心易碎 提交于 2021-02-11 13:10:38
问题 The base R function diff computes a first difference, useful for lagged data comparisons. I am looking for the GNU diff function accessible in R: https://www.computerhope.com/unix/udiff.htm This function is useful for version control, but also useful in natural language processes to identify changes or edits between two similar text elements. This is also an underlying engine of git and so on. Ideally the function would be gnudiff(text1,text2) and if tied to quanteda or another library, that

avoid auto merging of git conflicts and warn if same files getting modified in different branches

扶醉桌前 提交于 2021-01-29 09:12:16
问题 Usually when we merge feature branch with master or any other branch and if same file is modified in different branches but on different lines then GIT does resolve the conflict automatically. We dont want these merge happened automatically and expecting GIT should warn us with list of common files modified in two branches to be merged. e.g. In Master, we have file test1.txt as below AAA BBB Feature branch (feature/test1) created out of master and updated file test1.txt AAA BBB CCC also added

Git diff between current branch and master but not including unmerged master commits

旧巷老猫 提交于 2020-12-27 07:36:23
问题 I want a diff of all changes in a branch that is not merged to master yet. I tried: git diff master git diff branch..master git diff branch...master However, in each of these cases the diff contains content in master that has not been merged into my branch yet. Is there a way to do a diff between my branch and master that excludes changes in master that have not been merged into my branch yet? 回答1: git diff `git merge-base master branch`..branch Merge base is the point where branch diverged