Coder Social home page Coder Social logo

knoebber / dotfile Goto Github PK

View Code? Open in Web Editor NEW
99.0 6.0 3.0 556 KB

Simple version control made for tracking single files

Home Page: https://dotfilehub.com

License: GNU General Public License v3.0

Makefile 0.37% Go 97.18% CSS 1.66% HTML 0.34% Dockerfile 0.45%
dotfile dotfiles linux files version-control configuration dotfile-management file-share

dotfile's Introduction

Dotfile

Dotfile is a version control system designed for dotfiles. It aliases file paths to short names and provides an interface to manage file state. Use a remote server like dotfilehub.com to push, pull, or find new files.

Why Dotfile?

Most existing solutions are built on some combination of git/stow/symlinks. This introduces the complexities and potential pitfalls of these tools. Git is designed for a directory of related files, whereas dotfiles are often scattered unrelated files.

Dotfile is a self contained system designed from the ground up to make managing single files as simple as possible. Files are stored in their normal locations on disk without any symbolic links. Dotfile doesn’t care if tracked files are moved or edited with external tools.

Advantages over git based systems:

  • Not limited to one parent directory - initialize any file, even outside $HOME
  • No merge conflicts
  • Pull or push a single file instead of the entire repo
  • Revert a single file to a past revision without affecting other files
  • Easily rewrite or delete file history
  • Simple web interface for managing files remotely

Things Dotfile doesn’t do:

  • File encryption
  • Manage non text files
  • Manage large files
  • Templates
  • Branches

Getting Started

  1. Install the CLI
  2. Create a Dotfilehub account to share files between machines
  3. Setup the CLI to use remote functions

Optionally self host a Dotfilehub instance.

Documentation

Examples

Dotfile commands are like git but simplified.

Check a file in:

dotfile init ~/.bashrc

This creates an initial commit. Dotfile will store the path of the file and give it a default alias of bashrc. Use the alias to refer to it at anytime.

Open ~/.bashrc in $EDITOR:

dotfile edit bashrc

Check the diff after making changes:

dotfile diff bashrc

Commit new changes:

dotfile commit bashrc "Add dotfile alias"

View commit history:

dotfile log bashrc

Revert its uncommitted changes:

dotfile checkout -f bashrc

Push to a remote server:

dotfile push bashrc

Install all of your dotfiles:

dotfile pull --all

Contribute

Want to contribute? Open a pull request or an issue at github.com/knoebber/dotfile

Feedback is always appreciated - contact me at [email protected]

dotfile's People

Contributors

alexthemitchell avatar dooleydevin avatar knoebber avatar miniriley2012 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dotfile's Issues

Make CLI install easier

go install might not put the binary in the user's $PATH.

Also, should add AUR/Brew packages.

Implement diff

This should support diffing between different commit hashes, and diffing between uncommitted work and the current commit.

Throw error if checkout is going overwrite uncommited changes

It's convenient to revert a file back to its last commit and discard any new changes. Currently you can do this with dot checkout <filename>. This will discard any changes without telling user.

Instead it should throw an error like: "<filename>" has uncommitted changes, use -f to override.

Also implement -f option for checkout.

Implement checkout

This should revert the file to its state at the commit and change its "current" key in the json to the hash.

Improve diff

Diff currently it shows the full file. It should be smarter and only show areas that change while still providing enough context to know where the changes are.

Panics if you attempt to commit a file that isn't tracked

To reproduce

$ dot init ~/.bashrc
Initialized /home/nicolas/.bashrc as "bashrc"

$ dot commit bashrc
Created /home/nicolas/.dotfile/bashrc/786bc4cd0fdcb72c461b8f5465304e6bbc7c91c8

$ dot commit bashr
panic: runtime error: invalid memory address or nil pointer dereference

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.