Skip to content

Instantly share code, notes, and snippets.

Troubleshooting Git

Assumptions: You are operating from the root directory of your git repository. You do not have permissions to push to production. In this documentation, when you see something in tags (< >), it means to replace it with your actual value.

Reverting changes

git reflog
# you will see a list of everything you've done in git, across all branches
# each one has an index HEAD@{<index>}

find the one where things still worked

2017-03-09 11:34:28,980 ERROR [clojure-agent-send-off-pool-162] [p.e.file-sync-errors] Failed to sync repo :puppet-code: Error while sync'ing live code directory
org.eclipse.jgit.api.errors.JGitInternalException: Error while cleaning repo at /opt/puppetlabs/server/data/puppetserver/filesync/client/puppet-code.git. This may be due to a permissions problem or due to another repository existing in the repo. Could not delete file /etc/puppetlabs/code/modules/wsus_client/README.md
at puppetlabs.enterprise.services.file_sync_client.file_sync_client_core$eval33775$clean_BANG___33780$fn__33781.invoke(file_sync_client_core.clj:1129)
at puppetlabs.enterprise.services.file_sync_client.file_sync_client_core$eval33775$clean_BANG___33780.invoke(file_sync_client_core.clj:1116)
at puppetlabs.enterprise.services.file_sync_client.file_sync_client_core$eval33879$do_forced_sync_BANG___33884$fn__33885.invoke(file_sync_client_core.clj:1225)
at puppetlabs.enterprise.services.file_sync_client.file_syn
<UserLang name="Puppet" ext="pp">
<Settings>
<Global caseIgnored="no" escapeChar="\" />
<TreatAsSymbol comment="no" commentLine="no" />
<Prefix words1="no" words2="no" words3="no" words4="yes" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">&apos;&quot;0&apos;&quot;0</Keywords>
<Keywords name="Folder+">{</Keywords>
<Keywords name="Folder-">}</Keywords>
# stop Vagrant from trying to insert a secure key (makes authentication fail for me)
Vagrant.configure("2") do |config|
config.ssh.insert_key = false
end
#! /usr/bin/python
import sys
import signal
from json import dumps, loads
from platform import platform
from urlparse import urlparse
from socket import gethostbyaddr
from SocketServer import TCPServer, ForkingTCPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
# Not "Pythonic"
if 'keyname' in item.keys():
return item['keyname']
return None
# Is "Pythonic"
try:
return item['keyname']
except KeyError:
pass
In [1]: from medley.medley_lists.models import FastAutoList
In [2]: myFAL = FastAutoList.objects.get(id=57)
In [3]: res = myFAL.perform_search()
In [4]: 'teaseimage_url' in res[0].keys()
Out[4]: True
In [5]: 'teaseimage_url' in res[1].keys()
from medley.list_o_rama.models.auto import AutomaticList
myList = AutomaticList.objects.get(id=10)
myList.perform_search()