[WayBack] Syncing your fork to the original repository via the browser · KirstieJane/STEMMRoleModels Wiki · GitHub
TL;DR: you can do the sync from the Web UI, but it always gives you an extra merge commit.
–jeroen
Posted by jpluimers on 2020/12/31
[WayBack] Syncing your fork to the original repository via the browser · KirstieJane/STEMMRoleModels Wiki · GitHub
TL;DR: you can do the sync from the Web UI, but it always gives you an extra merge commit.
–jeroen
Posted in Development, DVCS - Distributed Version Control, git, GitHub, LifeHacker, Power User, Source Code Management | Leave a Comment »
Posted by jpluimers on 2020/12/16
Learned TWO things at once Mark Longair and VonC at [WayBack] git – Hard reset of a single file – Stack Overflow :
You can use the following command:
git checkout HEAD -- my-file.txt… which will update both the working copy of
my-file.txtand its state in the index with that from HEAD.
--basically means: treat every argument after this point as a file name. More details in this answer. Thanks to VonC for pointing this out.
Related:
Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »
Posted by jpluimers on 2020/12/01
I stick to git log --name-status as suggested in [WayBack] How to have git log show filenames like svn log -v – Stack Overflow.
A slightly less readable alternative isgit log --num-status .
There is also git log --name-only as suggested in [WayBack] How to show changed file name only with git log? – Stack Overflow
–jeroen
Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »
Posted by jpluimers on 2020/11/26
For my archive: [WayBack] Git Mergetool and difftool with Beyond Compare 4 · GitHub
I stuck to this as I:
- do not run
git bash- have Beyond Compared installed in the default directory (not the
x86one)- do not want a new UI instance, so use the recommended
BComp.exegit config --global merge.tool bc4 git config --global mergetool.bc4.cmd "'C:/Program Files/Beyond Compare 4/BComp.exe' \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"" git config --global mergetool.bc4.trustExitCode trueThis works splendid with
git mergetool: it starts a merge in the already openBCompare.exeinstance.I only do merge from Beyond Compare, so no need for me to do a similar Beyond Compare setup for
diff.tool, but if anyone wants it, it would be this:git config --global diff.tool bc4 git config --global difftool.bc4.cmd "'C:/Program Files/Beyond Compare 4/BComp.exe' \"$LOCAL\" \"$REMOTE\"" git config --global difftool.bc4.prompt false
This works fine for any git versoin > 2.2.0.
Related:
What I need to find out is if it is possible to open all merges at once in Beyond Compare. Maybe these help:
This did help getting rid of .orig files: [WayBack] version control – Git mergetool generates unwanted .orig files – Stack Overflow
–jeroen
Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »
Posted by jpluimers on 2020/11/25
Since I keep forgetting how simple it is: [WayBack] git – I ran into a merge conflict. How can I abort the merge? – Stack Overflow
If your git version is >= 1.6.1, you can use
git reset --merge.Also, as @Michael Johnson mentions, if your git version is >= 1.7.4, you can also use
git merge --abort.As always, make sure you have no uncommitted changes before you start a merge.
From the git merge man page:
git merge --abortis equivalent togit reset --mergewhenMERGE_HEADis present.
MERGE_HEADis present when a merge is in progress.Also, regarding uncommitted changes when starting a merge:
If you have changes you don’t want to commit before starting a merge, just
git stashthem before the merge andgit stash popafter finishing the merge or aborting it.
–jeroen
Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »
Posted by jpluimers on 2020/11/18
Checkout github pull requests locally. GitHub Gist: instantly share code, notes, and snippets.
Source: [WayBack] Checkout github pull requests locally · GitHub
The trick is to add one more fetch line to the [remote "origin"] sections in your .git/config files, as in the gist below.
fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
Which reminds me I should read more about that the fetch syntax which is called RefSpec: [WayBack] Git – The Refspec
–jeroen
Posted in Development, DVCS - Distributed Version Control, git, GitHub, Software Development, Source Code Management | Leave a Comment »
Posted by jpluimers on 2020/11/10
I didn’t know there were multiple ways to push to multiple remotes.
[WayBack] github – Git – Pushing code to two remotes – Stack Overflow is intriguing as the accept answer shows one remote can have more than one URL, and you can push to all of them at the same time.
Most people just have multiple remotes with one URL per remote, and have a branch optionally track one remote brach: [WayBack] How can I tell a local branch to track a remote branch?
The other way around: you can find out which branch track remote branches as well: [WayBack] git – Find out which remote branch a local branch is tracking – Stack Overflow
–jeroen
Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »
Posted by jpluimers on 2020/11/04
Out of the box, Visual Studio Code does allow you to pull from and commit/push to git repositories, but it has not much more git support.
These two marketplace extensions will help big time:
I like GitLens most as it covers so much more than just git history.
If you only need git history access, then you can use Git History as well.
More information and a better comparison:
–jeroen
Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »
Posted by jpluimers on 2020/10/29
I used these links to find out what entries a Katalon .gitignore file should contain:
Combining the above, the .gitignore file needs to at least contain:
/.classpath /.project /.settings bin/lib/ Libs/ /bin /Libs .settings .classpath settings/internal /.svn /bin/lib/Temp*.class Reports/ .project /libs/Temp*.groovy bin/lib/ bin/keyword/
(funny that .svn should be in a .gitignore file and that various combinations of casing are used)
–jeroen
Posted in Development, DVCS - Distributed Version Control, git, Katalon, Software Development, Source Code Management, Testing | Leave a Comment »
Posted by jpluimers on 2020/09/23
Start with this must read post: cross platform – What’s the best CRLF handling strategy with git? – Stack Overflow.
Then read all the links in that answer, especially
Then see if you agree with my conclusion:
use a .gitattributes file to steer line ending conversions on a per-repository base.
I usually try to have git not mess with any line endings: check-out as-is, check-in as is.
Historically this has been a mess (not limited to, but prevalent on Windows installations), not just because core.autocrlf has been superseded by core.eol, so below are some links that will help.
Always execute these after installing git:
git config --global core.autocrlf false
git config --global core.eol native
If needed, repeat in the current repository:
git config --local core.autocrlf false
git config --local core.eol native
Finally verify the settings with git config --list --show-origin (via [WayBack] Where does git config –global get written to? – Stack Overflow)
Note
The
git config listwill show equals signs. Do NOT use these when setting values: that will silently fail.So these fail:
git config --global core.autocrlf=false
git config --global core.eol=native
git config --local core.autocrlf=false
git config --local core.eolnativeDespite the output when listing on a machine that already had these values et:
git config --list | grep -w 'core.autocrlf\|core.eol'
core.autocrlf=false
core.eol=native
core.autocrlf=false
core.eol=native
core.autocrlf overrides core.eoltext attribute on a path tells Git not to attempt any end-of-line conversion upon checkin or checkout.core.safecrlf is set to “true” or “warn”, git verifies if the conversion is reversible for the current setting of core.autocrlf. For “true”, git rejects irreversible conversions; for “warn”, git only prints a warning but accepts an irreversible conversion. | Resulting conversion when | Resulting conversion when
| committing files with various | checking out FROM repo -
| EOLs INTO repo and | with mixed files in it and
| core.autocrlf value: | core.autocrlf value:
--------------------------------------------------------------------------------
File | true | input | false | true | input | false
--------------------------------------------------------------------------------
Windows-CRLF | CRLF -> LF | CRLF -> LF | as-is | as-is | as-is | as-is
Unix -LF | as-is | as-is | as-is | LF -> CRLF | as-is | as-is
Mac -CR | as-is | as-is | as-is | as-is | as-is | as-is
Mixed-CRLF+LF | as-is | as-is | as-is | as-is | as-is | as-is
Mixed-CRLF+LF+CR | as-is | as-is | as-is | as-is | as-is | as-is
╔═══════════════╦══════════════╦══════════════╦══════════════╗
║ core.autocrlf ║ false ║ input ║ true ║
╠═══════════════╬══════════════╬══════════════╬══════════════╣
║ git commit ║ LF => LF ║ LF => LF ║ LF => CRLF ║
║ ║ CR => CR ║ CR => CR ║ CR => CR ║
║ ║ CRLF => CRLF ║ CRLF => LF ║ CRLF => CRLF ║
╠═══════════════╬══════════════╬══════════════╬══════════════╣
║ git checkout ║ LF => LF ║ LF => LF ║ LF => CRLF ║
║ ║ CR => CR ║ CR => CR ║ CR => CR ║
║ ║ CRLF => CRLF ║ CRLF => CRLF ║ CRLF => CRLF ║
╚═══════════════╩══════════════╩══════════════╩══════════════╝
–jeroen
PS: To look at the various local and global settings, read Where does git config –global get written to? – Stack Overflow.
Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »
jpluimers commented