Code Monkey home page Code Monkey logo

git_split's People

Contributors

rodneyrehm avatar vangorra 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

Watchers

 avatar  avatar  avatar

git_split's Issues

Doesn't maintain directory structure

Great script, but it doesn't maintain the directory structure in the new repo. All files in the target subdirectory end up in the root of the new repo.

had to checkout another branch in the target repository

I had to checkout another branch in the target directory, otherwise I got:

remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error: 
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error: 
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.

So the commands which made it somehow work are

> mkdir ProjectARepo
> git init ProjectARepo
> cd ProjectARepo
> git checkout -b foo 
> cd ..

# copy over the master branch
> ./git_split myrepo master ProjectA ProjectARepo

Needs a few tweaks to work on OS X because of mktemp

Hey there, thanks for your contribution.

I noticed the use of mktemp -d on your script, which works perfectly on linux (and makes a lot of sense). However, when trying it on a OS X computer, the command needs to change to something like mktemp -dt "temp" where the "temp" can be whatever you want. At least that was my case. Here's how I solved it.

Unfortunately, by doing so, you're killing the functionality for linux computers. If you want a command that works well on both operating systems, I'd recommend changing it to something like:

mktemp -dt "temp.XXXXXX"

Just a suggestion, I don't think it qualifies as an "issue", since most people could find the answer without much hassle.

The target directory is not found

Output:
$ ./git_split.sh https://github.com/LogoFX/LogoFX.git master LogoFX.Client.Bootstrapping.Platform logofx-client-bootstrapping
Cloning into '/tmp/git_split.3a5XRZ/repo_base'...
remote: Counting objects: 5819, done.
remote: Compressing objects: 100% (91/91), done.
remote: Total 5819 (delta 52), reused 0 (delta 0), pack-reused 5726
Receiving objects: 100% (5819/5819), 1.42 MiB | 280.00 KiB/s, done.
Resolving deltas: 100% (4552/4552), done.
Checking connectivity... done.
Checking out files: 100% (638/638), done.
/tmp/git_split.3a5XRZ/repo_base/LogoFX.Client.Bootstrapping.Platform doesn't exist or is not a directory.

Steps to reproduce:

  1. Clone LogoFX from https://github.com/LogoFX/LogoFX.git
  2. Drop the script at the root level
  3. Execute the script with the parameters above.

Where did the files go?

Hi! I'm using your handy git-split script to break directories out of my repo and create new repos out of them. I'm very happy that you built this because in theory, this should make my life very easy.

Unfortunately, after the split, there are no files in the new repository from the old one. Here's what happens:

> ./git-split.sh clean_repo trunk/wwwroot ~/new_repo
Cloning into '/tmp/tmp.eKwnObj7Yv/repo_base'...
done.
Checking out files: 100% (185470/185470), done.
Creating Repo from clean_repo trunk/wwwroot for /home/user/new_repo
Initialized empty shared Git repository in /home/user/new_repo/
Rewrite 1c8d0412ceafde85b9e4b5cb5bec849aab1e8703 (19572/19572)
Ref 'refs/heads/master' was rewritten
Counting objects: 150013, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (66636/66636), done.
Writing objects: 100% (150013/150013), 977.74 MiB | 13.93 MiB/s, done.
Total 150013 (delta 98258), reused 113003 (delta 78597)
To /home/user/new_repo
 * [new branch]      master -> master

It looks great, except when I cd into new_repo, this is all I see:

branches  config  description  HEAD  hooks  info  objects  refs

Where did the files and directories from clean_repo/trunk/wwwroot end up? Is there anything I can do to make this work better?

Thank you!

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.