Conversation
Co-authored-by: mlutonsky <423848+mlutonsky@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Remove unintentional git pull after git switch -c
git-co: remove unintentional Mar 14, 2026
git pull --all after git switch -c
mlutonsky
approved these changes
Mar 14, 2026
There was a problem hiding this comment.
Pull request overview
Removes redundant and overly broad git pull --all invocations from git-co after creating a local branch that already tracks origin/<branch> via git switch -c.
Changes:
- Removed
git pull --allafter directorigin/<branch>creation inco(). - Removed
git pull --allafter single-match auto-checkout branch creation. - Removed
git pull --allafter interactive multi-match selection branch creation.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
git switch -c <branch> origin/<branch>already configures tracking, making the subsequentgit pull --allredundant and harmful — it pulls from all configured remotes, not justorigin.Changes
git-co: deleted all threegit pull --allcalls inco():origin/$1match checkoutOriginal prompt
git-co: remove unintentional git pull --all after git switch -c
File to modify:
git-coProblem
In the
co()function, after tracking a new remote branch withgit switch -c "$1" "origin/$1", the script runsgit pull --all. This fetches and pulls from all configured remotes, which is almost certainly unintentional — the branch is already set up to trackorigin/$1andgit switch -cwith a start-point does not need a follow-up pull. The same pattern appears in the multi-match interactive section too.Fix
Remove all occurrences of
git pull --allfrom the file. There are three occurrences:git switch -c "$1" "origin/$1"in the direct origin match block (around line 147)git switch -c "$branch_name" "origin/$branch_name"in the single-match auto-checkout block (around line 163)git switch -c "$branch_name" "origin/$branch_name"in the interactive multi-match selection block (around line 179)Simply delete those
git pull --alllines entirely. No other changes.The following is the prior conversation context from the user's chat exploration (may be truncated):
Assistant: Here's what you need to enable the Copilot coding agent so I can create pull requests autonomously:
How to Enable the Copilot Coding Agent
The coding agent is what allows me to write code, create branches, and open PRs on your behalf. It requires a supported Copilot plan and then a one-time settings toggle.
Step 1 — Confirm your Copilot plan
The coding agent is available on:
If you're on the free tier, you'll need to upgrade. You can check or upgrade at github.com/features/copilot/plans.
Step 2 — Enable the agent (personal account)
Since
mlutonsky/utilsis a personal (user-owned) repository, the coding agent should be available to you automatically once you have a qualifying plan. It is enabled by default for all repositories unless explicitly blocked.To verify or toggle it:
Step 3 — Enable GitHub Actions (required for the agent to run)
The coding agent uses GitHub Actions runners to do its work. Make sure Actions are enabled for the repository:
https://github.com/mlutonsky/utils/settings/actionsAfter enabling
Once those are in place, come back here and ask me to create the pull requests again — I'll be able to autonomously create branches, make all the code changes, and open a PR for each improvement for you to review and merge. See the full docs at Asking GitHub Copilot to create a pull request.
User: I have allowed it, so now please re-create these pull requests automatically
Assistant: All 10 pull requests have been submitted to mlutonsky/utils. Here's a summary of what was created:
LICENSEfile so users know they can freely use and adapt the scripts.github/workflows/shellcheck.ymlto automatically lint all shell scripts on every push and PRgit branch -D→git branch -dand adds an exit guard ongit fetch --prunepython3call instead of spawning one process per branchgit pull --allgit pull --allaftergit switch -c, which already sets up tracking[[ "$selection" =~ ^[0-9]+$ ]]guard to prevent a cryptic Bash error on non-numeric inputrotate_logfunction andMAX_LOG_LINESenv var to cap the log file at 10,000 linesgdbus callexit code directly instead of grepping stdout for the string"true"~/.local/bin/, with README and CLAUDE.md updatesYou can review them all at github.com/mlutonsky/utils/pulls and merge whichever you find useful.
User: ...
This pull request was created from Copilot chat.
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.