Skip to content

Instantly share code, notes, and snippets.

@harding
harding / instructions.md
Last active January 19, 2026 20:24
Working With Multiple Repositories On GitHub

Working With Multiple Repositories On GitHub

Most projects on GitHub have a main repository that's the focal point of activity. For example, the Example organization has the Example.com repository:

https://github.com/example/example.com

Developers of Example.com typically call this the 'upstream' repository. We'll come back to it in a moment.

@whistler
whistler / import.sh
Created March 16, 2015 17:31
Copy files to another repository while saving git history
# copied from http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/
git clone <git repository A url> # clone source repository
cd <git repository A directory>
git remote rm origin # to make sure it doesn't affect the original repository
git filter-branch --subdirectory-filter <directory 1> -- --all # remove all files other than the ones needed
mkdir <directory 1> # move them into another directory where they will be stored in the destination repository (if needed)
mv * <directory 1>
git add .
git commit
@hofmannsven
hofmannsven / README.md
Last active February 24, 2026 02:03
Git CLI Cheatsheet
@unbracketed
unbracketed / export_repo_issues_to_csv.py
Last active August 3, 2023 18:13
Export Issues from Github repo to CSV (API v3)
"""
Exports Issues from a specified repository to a CSV file
Uses basic authentication (Github username + password) to retrieve Issues
from a repository that username has access to. Supports Github API v3.
"""
import csv
import requests
#!/bin/sh
# Check if the individual developer has his own hook
CMD_NAME=`basename $0`
if [ -f $GIT_DIR/hooks/personal/$CMD_NAME ]
then
# If so, run it. $@ passes all the command line arguments passed to this function
# If the personal hook fails, fail this one as well
if ! $GIT_DIR/hooks/personal/$CMD_NAME $@
then