Skip to content

Instantly share code, notes, and snippets.

View mpotomin's full-sized avatar

Mikhail Potomin mpotomin

View GitHub Profile
@mpotomin
mpotomin / gmail-github-filters.md
Created March 2, 2019 20:50 — forked from ldez/gmail-github-filters.md
Gmail and GitHub - Filters

Gmail and GitHub

Create new filters and create new labels.

Pull Request

from:(notifications@github.com) AND {"Patch Links" "approved this pull request." "requested changes on this pull request." "commented on this pull request." "pushed 1 commit." "pushed 2 commits." "pushed 3 commits."}

label: gh-pull-request

@mpotomin
mpotomin / cloudSettings
Last active August 22, 2020 10:14
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-08-22T10:14:19.386Z","extensionVersion":"v3.4.3"}
@mpotomin
mpotomin / combining-git-repositories.md
Created November 10, 2018 11:04 — forked from msrose/combining-git-repositories.md
How to combine two git repositories.

Combining two git repositories

Use case: You have repository A with remote location rA, and repository B (which may or may not have remote location rB). You want to do one of two things:

  • preserve all commits of both repositories, but replace everything from A with the contents of B, and use rA as your remote location
  • actually combine the two repositories, as if they are two branches that you want to merge, using rA as the remote location

NB: Check out git subtree/git submodule and this Stack Overflow question before going through the steps below. This gist is just a record of how I solved this problem on my own one day.

Before starting, make sure your local and remote repositories are up-to-date with all changes you need. The following steps use the general idea of changing the remote origin and renaming the local master branch of one of the repos in order to combine the two master branches.

@mpotomin
mpotomin / git-reset-author.sh
Created November 9, 2018 20:08 — forked from bgromov/git-reset-author.sh
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD