Skip to content

Instantly share code, notes, and snippets.

@rokha
rokha / combining-git-repositories.md
Created January 16, 2020 05:45 — 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.

@rokha
rokha / git-tag-delete-local-and-remote.sh
Created November 27, 2019 13:31 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@rokha
rokha / ELK-disk-space-fix-steps.txt
Created September 4, 2019 08:28
Fix stuck (bitnami)ELK setup when node runs out of disk space
1. Delete the unnecessary indices. For example:
curl -XDELETE http://localhost:9200/index-name
2. Execute the following:
curl -XPUT http://localhost:9200/_settings -d '{"index": {"blocks": {"read_only_allow_delete": "false"}}}' -H 'Content-Type: application/json'
3. Restart logstash by
sudo /opt/bitnami/ctlscript.sh restart
4. Watch over the logs by
tail -f /opt/bitnami/logstash/logs/logstash.log
@rokha
rokha / jquery.ajaxQueue.js
Created December 21, 2017 19:08
A jquery plugin using a queue for handling ajax requests and to allow for wait, auto pause on error and resume from point of left off.Built for use case where network connectivity is fluctuating
/*!
* jQuery.ajaxQueue - A queue for handling ajax requests and to allow for wait, pause and resume.
*
* (c) 2017 @rokha
*
* Dual licensed under the MIT and GPL licenses.
*
* Requires jQuery 1.5+
*/
(function($) {