git

Is it possible to use the “minimal” algorithm for interactive adding?

好久不见. 提交于 2021-02-07 20:28:11
问题 Git doesn't always choose hunk boundaries correctly, when calculating a changeset from snapshots. git diff has a --diff-algorithm option that allows some tweaking in this regard; git diff --minimal sometimes gives better results than git diff alone. Is there a way to get the same optimised changeset layout also for git add -p (which basically shows the diff hunks interactively)? It doesn't seem to allow the --diff-algorithm option. 回答1: TL;DR version git -c diff.algorithm=minimal add -p

Is it possible to use the “minimal” algorithm for interactive adding?

微笑、不失礼 提交于 2021-02-07 20:27:15
问题 Git doesn't always choose hunk boundaries correctly, when calculating a changeset from snapshots. git diff has a --diff-algorithm option that allows some tweaking in this regard; git diff --minimal sometimes gives better results than git diff alone. Is there a way to get the same optimised changeset layout also for git add -p (which basically shows the diff hunks interactively)? It doesn't seem to allow the --diff-algorithm option. 回答1: TL;DR version git -c diff.algorithm=minimal add -p

Force push to Gerrit even with no new changes

[亡魂溺海] 提交于 2021-02-07 20:25:48
问题 I want to push a patchset to Gerrit which has already been pushed. Originally when the patches were sent up, the build system did not trigger. I need to trigger it again by resubmitting all patches. Gerrit rejects this with ! [remote rejected] HEAD -> refs/for/branch (no new changes) I know there are no new changes but I want to push anyway. How can I do this? --force flag has no effect. 回答1: Execute "commit --amend, change the commit message and push again. 来源: https://stackoverflow.com

Git: how to work with multiple repositories?

社会主义新天地 提交于 2021-02-07 20:19:33
问题 I have a remote read-only git repository A , which I have cloned in my local filesystem. A is updated periodically, and I pull and merge the updated code in my system after each update. I want to collaborate with my team members on the files of A , for which, I have create a new remote repository B . How do I manage to sync B with my local repository? I would like to learn the proper command sequence and configuration options to achieve my goals. Here are the scenarios I would like to be able

Fedora 33 git pull or clone no longer working and/or ssh key no longer recognized

為{幸葍}努か 提交于 2021-02-07 20:16:30
问题 I recently set up Fedora 33 and was migrating over my files. I copied over my ssh keys and found that I could no longer pull from bitbucket git repos I was able to pull from on my old laptop. The ssh keys are exactly the same, and the public key is already on the bitbucket account. Additionally the permissions were set to chmod 600 . I still can not pull from the repo. 回答1: This seems to be a recent issue around Fedora 33. This is the relevant bug report. The issue is that it seems like

Why is --first-parent not the default for git show?

北城余情 提交于 2021-02-07 20:14:41
问题 I'm sure this question will be closed as opinion-based but there's nowhere else so ask it so here goes... I'm trying to view the history of my branch which includes merge commits (specifically what changed) and I found a very useful post here git show of a merge commit that tells me to use git show --first-parent What's still confusing me is why --first-parent isn't the default for git show , or even why any other behavior is useful at all. If I'm looking in my history on a specific branch at

Why is --first-parent not the default for git show?

泪湿孤枕 提交于 2021-02-07 20:07:08
问题 I'm sure this question will be closed as opinion-based but there's nowhere else so ask it so here goes... I'm trying to view the history of my branch which includes merge commits (specifically what changed) and I found a very useful post here git show of a merge commit that tells me to use git show --first-parent What's still confusing me is why --first-parent isn't the default for git show , or even why any other behavior is useful at all. If I'm looking in my history on a specific branch at

Take sha number of commit by tig

女生的网名这么多〃 提交于 2021-02-07 19:53:20
问题 I love to use tig client to navigate through git commits. But I'm missing one thing for now. Is there a key binding to take a sha number of a git commit I'm currently staying at? 回答1: Check if the command proposed in jonas/tig issue 557 would work for you: bind generic 9 !sh -c "echo -n %(commit) | xclip -selection c && echo Copied %(commit) to clipboard" That would copy the current commit SHA1 in your clipboard. In the Wiki binding page, you also have example for Mac or Cygwin: bind generic

Take sha number of commit by tig

廉价感情. 提交于 2021-02-07 19:48:27
问题 I love to use tig client to navigate through git commits. But I'm missing one thing for now. Is there a key binding to take a sha number of a git commit I'm currently staying at? 回答1: Check if the command proposed in jonas/tig issue 557 would work for you: bind generic 9 !sh -c "echo -n %(commit) | xclip -selection c && echo Copied %(commit) to clipboard" That would copy the current commit SHA1 in your clipboard. In the Wiki binding page, you also have example for Mac or Cygwin: bind generic

Visual Studio Extensibility: Get the Git repository's path from Team Explorer's Git Commit Details page

冷暖自知 提交于 2021-02-07 19:29:59
问题 I am adding Git integration to my Visual Studio extension Diff All Files, which allows for quickly diffing (i.e. comparing) all files in the Team Explorer window with a previous version. I have it working with the Git Changes page (in Team Explorer), since when I get the Microsoft.TeamFoundation.Git.Controls.Extensibility.IChangesExt service the files in it's IncludedChanges property contain the full file path on disk. However, when working with the Git Commit Details page I get the Microsoft