• This repository has been archived on 19/Dec/2019
  • Stars
    star
    160
  • Rank 234,703 (Top 5 %)
  • Language
    Shell
  • Created almost 13 years ago
  • Updated over 12 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Use git as a sync tool, without munging your source and sync VCS operations

git-sync

There's a bunch of web deployment systems lately that use git for uploading applications.

I hate this.

Deployments are not just a checkpoint in your application development, they are also something that itself needs to be developed and tested. When I use one of these systems I find myself with lots of this:

$ ...edit app.conf...
$ git commit -a -m "conf" ; git push deploy

Pthfb.

That said, git is not a bad file synchronization tool. It's actually pretty darn fast; faster than rsync because it keeps more state around (rsync has to recheck the world each time). And it gives you a nice history of what you've done.

This command lets you use git like a sync tool, separate from using it as your source control. It's written as a git extension because whatever.

Using git-sync

Put git-sync somewhere on your $PATH. You can call git-sync or git sync.

You must then configure your git repository with a few commands:

# Where to upload to:
$ git config --add sync.default.remote [email protected]:repo.git
# Kind of a scratch location to keep the files in:
$ git config --add sync.default.repo .git/sync

Now you can just run git sync and it will upload everything, including uncommitted work. (It also uploads untracked files, which... maybe it shouldn't. But files in .gitignore should be ignored regardless.)

You can also run a build step everytime you do a sync:

# Optional setting:
$ git config --add sync.default.build tools/build

Now everytime you run git sync it will run the script in tools/build and upload the results. You can use this to run a source compressor or whatever else you might want to do before an upload. The results of your build will be committed and pushed. The commad will be run with the current working directory of the files ready to be uploaded (not your normal source repository).

If you want to leave files out of what gets sync'd, but still keep those files in your source repository, create a file named .syncignore (similar to .gitignore). E.g., put tools/ into that file to keep your build tools from getting uploaded.

Note in all these that default is a string you can change, e.g., you can make configuration values for production (sync.production.remote) and do git sync production.

History

You'll still have a nice set of history of what you've uploaded, though that history will be strictly per-remote. It won't be directly attached to your main repository, but the commit messages will show the relation.

Each commit has a commit log message deploying $version where the version the output of git describe --always --dirty. That command outputs the tag, branch, or if necessary just the latest revision of the repository. The string -dirty is appended when there is uncommitted work.

More Repositories

1

infinite-ai-array

Do you worry that you'll get to the end of a good list and have nothing more, leaving you sad and starved of data? Worry no more!
Python
167
star
2

walkabout.js

An automatic web app tester
JavaScript
155
star
3

doctestjs

Javascript testing made easy and explicit
JavaScript
145
star
4

llm-garden

A number of experiments using GPT-3, delivered in a web app
JavaScript
48
star
5

jsshell

Shell (ala bash) written in Javascript for the browser and Node.js (incomplete prototype!)
JavaScript
47
star
6

personal-history-archive

An experiment in creating a dump of your personal browser history for analysis
Jupyter Notebook
33
star
7

neighborly

Neighbor-to-neighbor communication tool
Python
28
star
8

pywebapp

Support library for Python Web Applications
Python
19
star
9

sticky-reader-mode

A browser extension to turn on Reader Mode automatically per your preference
JavaScript
18
star
10

seeitsaveit

A Firefox Addon to extract and route information from web pages using ad hoc user scripts
JavaScript
16
star
11

whrandom

A port of Python's pseudo-random generator, whrandom
JavaScript
13
star
12

thecutout

A data storage and synchronozation system for client/browser-based applications
Python
11
star
13

wsgibrowserid

Stand-alone app to implement relying-party browserid.org support
Python
8
star
14

copy-keeper

An experimental add-on for saving everything you copy
JavaScript
7
star
15

webannotate

Annotate (add comments to) web pages
JavaScript
6
star
16

blog

My blog
HTML
6
star
17

find-plus-one

An experimental browser extension for search in pages linked from the current page
JavaScript
6
star
18

tab-switchr

Experimental super-simple tab switching add-on
JavaScript
5
star
19

wsgi-access-control

Access-Control-Allow-Origin etc middleware for WSGI
Python
4
star
20

apppkg

Application Package, a format for executable introspectable stuff
Python
4
star
21

fatfingers

A Javascript library to turn inaccurate touches into a modal selection to disambiguate
JavaScript
3
star
22

python-dc311

Python API for the Washington DC 311 API
Python
3
star
23

copy-url-extension

Small Firefox extension to make it easy to copy the page URL with the title
JavaScript
3
star
24

emailit

A very little Python app to email web pages to people
JavaScript
3
star
25

statusnet-firefoxshare

A Status.net plugin for Firefox Share (F1) support
PHP
2
star
26

alexa-sites

Whitelist of common sites, using Alexa as a basis
Shell
2
star
27

browsercommander

A browser-based shell and general system commander
JavaScript
2
star
28

thrive-ai

Implementation of the game Thrive, with some basic AI
Python
2
star
29

cmdutils

Python
2
star
30

phrase-matcher

JavaScript library to pattern-match English phrases
JavaScript
2
star
31

bitplanning

Playing around with Logic Planning, as described in Artificial Intelligence: A Modern Approach
Jupyter Notebook
2
star
32

app1.ianbicking.org

Test app
HTML
2
star
33

xmasapp

Little (open)webapp for Christmas Lyrics
Python
2
star
34

aitc-html

Apps In The Cloud HTML implementation
JavaScript
1
star
35

partial-language

An experiment with a partially-evaluated language: https://www.ianbicking.org/blog/2020/09/project-ideas-2020.html#partial-evaluation
JavaScript
1
star
36

intent-experiment

Just playing around with intent parsing
Shell
1
star
37

fungpt

Code for a presentation on coding with GPT
JavaScript
1
star
38

silverlining

(deprecated) A system to make easily deployable applications
Python
1
star
39

soul-faith

Open Soul named "Faith"
TypeScript
1
star
40

logdb-app

App structure for logdb
1
star
41

wphp

(deprecated) WSGI wrapper for PHP
Python
1
star
42

sheets

Experimenting with a Jupyter Notebook-style Python interface
Python
1
star
43

memebot

Messing around with meBot programming
Python
1
star
44

misc-recipes

These are old bits of code I kept on my once-SVN server
Python
1
star
45

crossnav

An experimental add-on to offer different ways to navigate from a page (besides in-page hyperlinks)
1
star
46

intra-game

An LLM text adventure game
TypeScript
1
star