Posts tagged 'git'

Tag: git

June 12, 2026 · Note · 1 min read · 66 words

How to get all branches from a git remote and push them to a new remote

git push newremote refs/remotes/oldremote/*:refs/heads/*

This command will push all branches from the oldremote to the newremote. The refs/remotes/oldremote/* part specifies that we want to push all branches from the oldremote, and the refs/heads/* part specifies that we want to push them to the newremote as branches.

For tags, that would not be so much complex, just git push newremote --tags would be enough.

Found at https://www.metaltoad.com/blog/git-push-all-branches-new-remote.

Optimizing Git Branch Naming & Syncing with Upstream Repositories

April 30, 2025 · 6 min read · 1098 words

When working with multiple remote repositories, especially when syncing changes from upstream (such as in a forked repository), it’s important to have a well-structured system for organizing and tracking branches. This ensures clarity, ease of maintenance, and the ability to manage branches effectively. In this post, we’ll walk through the decision-making process for setting up a clear naming convention and syncing branches between your repository and an upstream one.

Read More
February 16, 2022 · Note · 1 min read · 34 words

Use Ssh For Github Https Urls

Git can be configured to use SSH in place of HTTPS for URLs matching a given prefix. To use SSH for all GitHub access, add these lines to ~/.gitconfig:

[url "ssh://git@github.com/"]
  insteadOf = https://github.com/