Giter Club home page Giter Club logo

bypo's Introduction

Bypo

Use this ruby script to create two local git repositorys. One for local and one --bare repository for remote, but on the same machine.

Useful to host your remote repo e.g on your dropbox folder and sync them between your workplace and your home and devices.

Do not use this technique for working in a team!

How to

Change the paths in the script:

LOCAL_PATH = 'C:\xampp\htdocs'
REMOTE_PATH = 'C:\Users\Windows\Desktop\Dropbox\repos'
UPSTREAM_NAME = 'dropbox'

Warning: If you on windows, dont use double quotes " for the path string. Because windows has backslashes, they would be escaped.

The upstream name in git is normally origin, but i named it dropbox, because it is clearer what it means.

Call the file in your terminal:

$ ruby path/to/bypo.rb

You will be prompted for a name for your repository. This command will create a name.git folder in your remote path, and a name folder in your local path. Further it creates a .gitignore file with few placeholders and makes a "initial commit" and push it to your remote repository.

Notice: If you have a folder in your LOCAL_PATH or REMOTE_PATH with the same name, you will be prompted and you can enter a new name.

The script automatically sets a new remote connection for your local file to the remote file. So you can use normally git push and others from your local file.

Tip for OSX and Linux user

You can make the script executable with a double click. Run this in your terminal:

$ chmod a+x path/to/bypo.rb

and change the .rb extension to .sh.

ToDo

  • Rewrite code
  • Validating
  • Enter paths in console as first step and save them
  • Smart GUI
  • Two modes: Clone repo and Create new repo

bypo's People

Contributors

devfake avatar

Watchers

 avatar  avatar  avatar

Forkers

projectarchives

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.