Coder Social home page Coder Social logo

git-transfer's Introduction

About this tool

When you need to refactor files from one git repository to another it's not trivial to do so unless you don't mind loosing the history. This tool let's you refactor files between two git repositories keeping the commit history.

sample commands

./gittransfer.sh --source-path=[relative/absolute path] --source-remote="git@[git-repo-url].git" --target-path=[relative/absolute path] --remove-exclude-filroe=../file.txt --branch-name=temporary-merge --verbose=false
./gittransfer.sh '--source-path=[path to source repo folder]' \
'--source-remote=[remote git repo: git@*.git]' \
'--target-path=[target repo folder path]' \
'--remove-exclude-file=[path to file with filenames to transfer from source repo]' \
'--branch-name=[name of temporary git branch to use for transfer]' \
'--verbose=[optional if you want to see extra logging]'
./gittransfer.sh '--source-path=[path to source repo folder]' \
'--source-remote=[remote git repo: git@*.git]' \
'--target-path=[target repo folder path]' \
'--remove-exclude-file=[path to file with filenames to transfer from source repo]' \
'--branch-name=[name of temporary git branch to use for transfer]' \
'--verbose=[optional if you want to see extra logging]' \
'--dry-run=[optional flag to make a dry run]'

parameters

--source-path: Local path to the source git repository. This is the repository that contains the files that will be transferred.

--source-remote: Remote git url of the source git repository. This is needed so the repository can be added as a remote repository.

--target-path: Local path to the target git repository. This is where the files coming from the source repository will be merged.

--remove-exclude-file: Path to a text file containing the names of the files wanted to be transferrred and merged from the source into the target repositories.

--branch-name: Name of the temporary branch to be used during the transfer of the files. Notice these branches are temporary and will get deleted each time the script runs. The temporary branch will be kept after a run so that users can then make merge/pull request into the master branch.

--verbose: Optional flag to include extra logging during the running of the script.

--dry-run: Optional flag to run the script in dry mode. This mode will not perform any file transfers/removal of files. It will only display which files would be transferred if it ran normally. This is recommended to use before running it normally so ensure the script is setup correctly.

--force-delete: Optional flag to skip the prompt to confirm the removal and transfer of the files into the target repository. During a normal run, the script will prompt the user to confrim with a y or n before proceding with the removal and transfer of files. This is intentional to avoid deleting not desired files in the computer. However if you feel confident that the script parameters are setup correctly, then you can use this option. This option is only recommended for advance usages. I recommend relying on the prompt if you don't need this option.

git-transfer's People

Contributors

aciokler avatar

Watchers

 avatar

git-transfer's Issues

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.