Skip to content

Instantly share code, notes, and snippets.

View ryandaniels's full-sized avatar
🙃

Ryan Daniels ryandaniels

🙃
View GitHub Profile
@ryandaniels
ryandaniels / firefox-user.js
Last active December 5, 2022 06:17
Firefox user.js privacy and optimization settings
/*
* Open profile dir - find in about:support or about:profiles
* Copy this file into your profile directory.
* Add changes to this file. Save file.
* Restart Firefox. Below overrides will be loaded.
* Close Firefox and open prefs.js to confirm changes merged there.
* NOTE: only non-default values will be saved to prefs.js
*
*/
@SKempin
SKempin / Git Subtree basics.md
Last active April 27, 2024 20:22
Git Subtree basics

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:

@rvl
rvl / git-pushing-multiple.rst
Created February 9, 2016 11:41
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just