Git Product home page Git Product logo

gitreplay-bash-script's Introduction

GitReplay with Bash

P532 - Sub-Project : Bash Script to display a menu with different options to replay commits.

The script is written using Git and Bash, and can be used to grab the commits from one repository (say Repo1) and replay it in another one (say Repo2). The script resets the target repository, Repo2, by initializing a new local repository and forcing it on Repo2 upstream. The commits can be replayed incrementally using a Replay Menu.

This script is not directory specific. When executed, the script will make temporary directories in the current folder and remove them when it's finished.

Important variables

repoReplayGit : Should contain Git SSH of empty/useless repository which you have push access to.

Note: This repository will be reintialized and all commits from this repo will be erased before replay.

delay : This is the time delay between two commit/push (in seconds). By default it is set to 40 (40 seconds). This variable just contains a numerical value, that is used to contdown between commits.

How to run

  1. Navigate in Terminal to the folder where the script is located

  2. Ensure that script has proper permission to execute

    chmod +x p532-git-script.sh
    
  3. Ensure that git repository in the script "repoReplayGit" points to an empty/useless repository since it will be erased and reintialized before replay. Also make sure you have push access to this repository

  4. Get the Git SSH (example: [email protected]:user/repository-name.git or [email protected]:~/path/to/repo) for the repository you want to replay.

  5. Run the script with the Git SSH from step 4 as the argument

    ./p532-git-script.sh [email protected]:user/repository-name.git
    or 
    ./p532-git-script.sh [email protected]:~/path/to/repo
    
  6. Menu options

    Replay Menu

    • Replay next commit : Replays the next commit in the list
    • Replay next n commits : Takes a numerical input from the user, say n. Then pushes n number of commits.
    • Replay all remaining commits : Replays all the remaining commits from the list
    • Exit : Exits the menu

gitreplay-bash-script's People

Contributors

asadana avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

voraj

gitreplay-bash-script's Issues

First replay is blank

If replay next commit is used at the beginning, it shows a blank SHA.

This is carried on if you choose 2 next commits, only one shows up in the beginnning

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.