Skip to content

Instantly share code, notes, and snippets.

View saschazepter's full-sized avatar

Sascha Zepter saschazepter

View GitHub Profile
@saschazepter
saschazepter / hg-git-sync.sh
Created November 9, 2024 23:08 — forked from lietu/hg-git-sync.sh
Sync a Mercurial (hg) repository to a Git repository
#!/usr/bin/env sh
set -exu
# Which Git repo to sync with - change this for sure
GIT_REPO="git@..."
# Paths
HG_REPO="$(pwd -P)" # You might need to change this
GIT_TMP="/tmp/git-sync-$(date +%s)"
@saschazepter
saschazepter / gist:b1fa3e235b62e56dc1a851b848700394
Created November 7, 2024 19:21 — forked from CrookedNumber/gist:8964442
git: Removing the last commit

Removing the last commit

To remove the last commit from git, you can simply run git reset --hard HEAD^ If you are removing multiple commits from the top, you can run git reset --hard HEAD~2 to remove the last two commits. You can increase the number to remove even more commits.

If you want to "uncommit" the commits, but keep the changes around for reworking, remove the "--hard": git reset HEAD^ which will evict the commits from the branch and from the index, but leave the working tree around.

If you want to save the commits on a new branch name, then run git branch newbranchname before doing the git reset.

# Repo: someuser/myframework
# Fork: superteam/myframework
# Track:
git clone https://github.com/superteam/myframework.git
cd myframework
git remote add upstream https://github.com/someuser/myframework.git
# Update:
git fetch upstream
@saschazepter
saschazepter / gist:e75b03d4147fd99b5ab8ea0601cd1fae
Created November 7, 2024 15:50 — forked from JPBlanc/gist:1082221
Retreive the FSMO roles from a Domain Controler usind ADSI
'==========================================================================
'
' NAME: fSMORoleOwner.vbs
'
' AUTHOR: JPB , Silogix
' DATE : 13/07/2011
'
' COMMENT: This script allow to retreive the five FSMO Role Owners
'
'==========================================================================
@saschazepter
saschazepter / MigrateSVNtoGIT.md
Created November 7, 2024 15:49 — forked from amura2406/MigrateSVNtoGIT.md
Tutorial to migrate from SVN to Git

Install svn2git.

On all systems you can install as a Ruby gem if you already have Ruby and Git installed.

sudo gem install svn2git

Checkout SVN Repo

Checkout the latest SVN Repository of the project you want to convert.

svn co --username <your_name> https://svn.server.com/repository/trunk

Keybase proof

I hereby claim:

  • I am saschazepter on github.
  • I am saschazepter (https://keybase.io/saschazepter) on keybase.
  • I have a public key ASCdhQcrbaMQuO4D6IOhKLIRRyb9C9dPktQ8pZwCtfQxjgo

To claim this, I am signing this object: