Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Reviewing a StoryQuest submission #957

Locked
Jul 18, 2025 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

git checkout $(git merge-base main HEAD) scenes/tileset.tres

You can use the ... syntax here too, at least when using git restore which is the newer spelling for the "restore the contents of files" behaviour of checkout:

-s <tree>, --source=<tree>

Restore the working tree files with the content from the given tree. It is common to specify the source tree by naming a commit, branch or tag associated with it.
If not specified, the contents are restored from HEAD if --staged is given, otherwise from the index.
As a special case, you may use A...B as a shortcut for the merge base of A and B if there is exactly one merge base. You can leave out at most one of A and B, in which case it defaults to HEAD.

So I believe you can spell that command as:

git restore --source=main... scenes/tileset.tres
You must be logged in to vote
1 reply
Comment options

manuq Jul 21, 2025
Maintainer Author

git restore --source=main... scenes/tileset.tres

Much better, thanks! Updated. The only difference is that git checkout $(git merge-base main HEAD) scenes/tileset.tres was adding the file to the git cache. I prefer doing git add myself so this is better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /