git-fetch

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

git fetch + git merge origin/master vs git pull origin/master

一个人想着一个人 提交于 2021-02-11 16:55:45
问题 I thought git pull was like a git fetch + git merge. Being in branchA, I always do a git fetch and then a git merge origin/master. But today, being in a branchA, I tried git pull origin/master and it didn't work but doing a git pull origin master worked. Any thoughts? Extra question, if an updated origin/master and the online version of master are the same, why bother to have origin/master, wouldn't it be more convenient to always work with the online version that is always updated, releasing

Syncing fork with upstream: git fetch + git checkout + git merge vs. git checkout + git pull

微笑、不失礼 提交于 2020-08-10 18:21:47
问题 The documentation at Github-Help: Syncing a Fork shows three commands to keep my GitHub fork in sync with the upstream repo. git fetch upstream git checkout master git merge upstream/master Can I use the following two commands instead of the above three? git checkout master git pull upstream/master Are the two sets of commands equivalent, or are there differences between them? 回答1: These command sets are not equivalent. git pull is split into two commands: git fetch git merge The problem is,