Posts tagged 'git'
Tag: git
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
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.
How to use a different SSH credential for a specific git repository
If you have multiple SSH keys and want to use a specific one for a particular Git repository, you can do so by configuring it on the SSH config file:
How to use private repositories as npm git dependencies on Github Actions
I’m advocate of automatization, and that includes not only CI/CD pipelines, but also I wanted to do it for documentation publishing. Mafalda is split in a lot of packages (currently more than 30!), so I wanted to have a single place where to publish the documentation of all of them. Github Pages allows to host a website for your organization or username for free (this blog and personal site already makes use of it), and it can also host automatically a website for each repository as sub-paths of your username/organization main website. Problem is, that it only works for open source repositories or for paid plans, and most of the Mafalda SFU repositories are private ones. So since the Mafalda SFU project website is already hosted on Github Pages as a public repository, I decided to store and serve from it all the other repositories documentation as well… doing it in an automated way :-)
How to use a different email for a group of git repositories
If you have a folder with multiple repositories that you want your commits use a different email account, but keep using your (personal) one for anything else, you can do it in two steps: