How to Pin Git SHAs, Paths, and PR URLs for Reuse
A git workflow generates a specific kind of clipboard churn: file paths, commit SHAs, branch names, PR URLs, issue keys. These items are useful for the duration of a task — a code review, a debugging session, a deploy — and they become noise the moment the task ends. Most developers do not have a habit for retiring them. The clipboard history fills up with last week's SHAs, and by the time the developer needs to find yesterday's PR URL, it has scrolled out of the 25-item Win+V window and is gone. The developer goes to GitHub, searches for the PR, and loses two minutes. Repeat ten times a day.
This guide is about treating git workflow items as a pin set: pin the working set for the current task, let the rest expire. It is written for developers who work in git all day and want their clipboard history to reflect the current task, not the last month. For neighbouring topics, see JetBrains copy/paste history vs a system shelf, WSL and Windows clipboard: what crosses the boundary, and best clipboard habits for developers in 2026.
What a git pin set contains
For a typical task — a code review, a bug investigation, a feature branch — the working set is small and predictable:
- The PR URL — the canonical link to the pull request. Used in chat, in standup notes, in commit messages, in deployment tickets.
- The branch name — pasted into CI configs, deployment commands, and chat. Usually short (
feature/auth-refactor), usually typed more often than pasted, but useful as a pin when the branch name is long. - The file path(s) under review — relative paths from the repo root (
src/auth/handlers.py). Pasted into grep commands, into chat when pointing a colleague at a file, into tickets. - The latest commit SHA — pasted into
git checkout,git reset,git revert, and into chat when referencing a specific change. Usually 7 characters short-hash for chat, full 40 characters forgitcommands. - The issue key —
PROJ-1234. Pasted into commit messages (for auto-linking), PR descriptions, and chat.
That is five items. They are the working set for the task. Everything else — the previous PR's URL, last week's SHAs, the file paths from the last merge — is noise.
What does not belong in the pin set
- Old commit SHAs. Once a PR is merged, the SHAs in its history are reference material, not working set. If a developer needs to reference an old commit,
git logorgit blameis faster than scrolling the clipboard. - Old PR URLs. Same. The PR is closed; the URL still works but is no longer part of the current task.
- Old branch names. Especially old branch names. Pasting
feature/auth-refactorwhen the current branch isfeature/auth-cleanupis a small but real mistake that has wasted many minutes. - File paths from other repos. Pasting a path from repo A into a command run against repo B is a
gitfailure mode.
The pin-then-expire pattern
The pattern is borrowed from the seasonal campaign kit workflow in seasonal campaign kits: pin, ship, unpin. For a git task:
- At task start, pin the five items above. Most clipboard managers support pinning individual items; Win+V has a pin toggle on each entry.
- During the task, use the pinned items from the panel rather than re-typing them. The pin set is one click away; the alternative is three clicks through GitHub.
- At task end, unpin everything. Either delete the items explicitly or let the clipboard manager's auto-clear handle them. Win+V's unpinned items clear on restart; a more aggressive tool can clear them on a timer.
The discipline takes 30 seconds at task start and 30 seconds at task end. It saves 5 to 10 minutes of "what was that SHA again" over the course of the day.
SHA hygiene specifically
Commit SHAs are the most frequently mis-clipboarded git item. A few specific habits help:
- Use the 7-character short hash for chat, the full 40-character hash for commands. Chat is forgiving;
gitcommands sometimes require the full hash (forgit revert, for example, depending on the version). - Do not paste a SHA from before a rebase. A rebase rewrites commit history; the SHAs change. A SHA copied before a rebase will not exist after the rebase. If a developer needs to reference a pre-rebase commit, the SHA is in
git reflog, not in the clipboard. - Do not paste a SHA from a different repo. This sounds obvious, but with multiple checkouts on the same machine (a frontend repo and a backend repo, say), it is easy to copy from one and paste into a command against the other.
- Pin the SHA at task start, not in the middle. Mid-task SHAs are often intermediate commits that will be squashed; the post-squash SHA is what the team will reference later.
Path hygiene specifically
File paths in git workflows have their own quirks:
- Use relative paths from the repo root, not absolute paths.
src/auth/handlers.pyis portable across machines;C:\Users\name\repo\src\auth\handlers.pyis not. Chat with colleagues, tickets, and PR descriptions should all use relative paths. - Quote paths with spaces.
src/auth/user service.pywill break most commands;"src/auth/user service.py"will not. - Use forward slashes even on Windows. Git accepts forward slashes on all platforms; backslashes only work on Windows. Forward slashes are portable.
- For WSL paths, use the WSL form. A Windows path like
C:\Users\name\repobecomes/mnt/c/Users/name/repoin WSL. Pasting the Windows form into a WSL command will fail.
For more on path translation between Windows and WSL, see WSL and Windows clipboard: what crosses the boundary and how to copy a file path that works in the terminal.
A worked example
Consider a code review session. The developer is reviewing PR #482 in repo auth-service. The working set:
- PR URL:
https://github.com/org/auth-service/pull/482 - Branch:
feature/token-redaction - Files under review:
src/auth/handlers.py,src/auth/tokens.py,tests/test_tokens.py - Latest SHA:
a1b2c3d4e5f6789012345678901234567890abcd - Issue key:
AUTH-219
These five items get pinned. Over the course of the review, the developer pastes:
- The PR URL into a Slack thread with the team.
- The branch name into a
git checkoutcommand to pull the branch locally. - The file paths into
grepcommands, into chat when pointing at specific lines, and into the review comments. - The SHA into
git diff a1b2c3d4..HEADto see what changed since the last review. - The issue key into commit messages on the local checkout.
When the review is done, all five items are unpinned. The next task has its own working set; the previous task's items are noise.
Tooling that helps
- Win+V pinning — built into Windows, supports up to 25 items with pinning. Sufficient for most single-task workflows.
- Ditto — extends the Win+V concept with named groups, so a developer can have a "PR-482" group that holds the five items and is deleted when the task ends.
- Edge-Drop — adds spatial access (hover-open edge shelf) and is well suited to holding a working set of pinned items for the duration of a task. Does not extend history depth.
- A notes file — for developers who prefer text files to clipboard managers, a
current-task.mdfile with the five items is the simplest possible pin set. Open in a side panel; copy from there as needed.
The tool matters less than the discipline. The discipline is: pin at task start, use during the task, unpin at task end. Without the discipline, no tool helps; with the discipline, any of these tools works.
Why this discipline scales for teams
For a solo developer, the pin-then-expire pattern is a personal habit and saves a few minutes a day. For a team, the same pattern is a coordination mechanism. When every developer on the team pins the same five items for the same PR, the team's chat threads, tickets, and standup notes all reference the same links. There is no "which PR are you talking about?" question; the PR URL is pinned and pasted. There is no "wait, which SHA did you build from?" question; the SHA is pinned and pasted.
The coordination emerges from the shared discipline, not from a tool. A team that does not pin has the same conversation ten times a day: "let me find the link", "wait, let me check the branch name", "I'll get the SHA in a sec". A team that pins has those answers ready. The difference is small per interaction but compounds across a sprint.
When the pin set is wrong
A pin set that has not been updated is worse than no pin set. If a developer is reviewing PR #482 but their pinned SHA is from PR #481, every paste is wrong. The discipline is not just "pin at task start"; it is "unpin at task end and re-pin at the next task start". A stale pin set is the failure mode the discipline exists to prevent.
The fix is simple: when the task changes, clear the pins and re-pin from scratch. It takes 30 seconds and prevents the wrong-SHA-paste class of mistake. The auto-clear-on-restart behaviour of Win+V's unpinned items is a safety net, not a substitute; the developer who closes their laptop at 5pm with PR #482 still pinned will open it at 9am with PR #482 still pinned, and the next task's pins will be mixed in with the stale ones.
Related reading
- WSL and Windows Clipboard: What Crosses the Boundary
- Copying From Windows Terminal Without Garbled Codes
- Best Clipboard Habits for Developers in 2026
- Clipboard Tools on Multi-Monitor Windows Setups
Sources
- Git — Reference documentation — official git documentation, including the SHA-1 hash format and the commands that accept short versus full hashes
- GitHub — About pull requests — official GitHub documentation for PR URLs and the canonical link format
- Microsoft Support — Using the clipboard on Windows — official Win+V documentation, including pinning behaviour
- Atlassian — Git tutorials — widely-referenced git tutorials covering branch workflows, rebasing, and the SHA lifecycle
- Ditto — GitHub README — clipboard manager with named groups, useful for task-scoped pin sets
Deepender Yadav is a B.Tech Computer Science Engineering student and software developer interested in building practical software and open-source projects.
GitHub · LinkedInCopy. Stack. Drop.
Transform your clipboard into an interactive edge shelf. Stack, pin, and drag assets into any app with zero friction.
Download for Windows Get from Microsoft Store
How to Install Guide · First 10 Minutes Guide · Drag & Drop Guide · Edge-Drop vs Win+V · Support
Free · Lightweight · Privacy First