Giter Club home page Giter Club logo

Comments (6)

earwig avatar earwig commented on July 18, 2024

There's nothing built-in to do this, and it seems a bit dangerous to add because a temporary issue with the remote (like a permissions issue) would cause your local copy to get deleted. You also need to consider situations with multiple remotes or when we have branches out of sync with the remote we can't update. Basically, I'm not sure what a "safe" check for this would look like.

from git-repo-updater.

Shooter3k avatar Shooter3k commented on July 18, 2024

Maybe I'm not using this application for it's intended purpose? At my work, we have around 500 repos. With that many, they get moved or deleted fairly often and the only way for me to fix it is to find them by hand and manually delete them.

Do you have any suggestions for how I can remove these deleted repos?

from git-repo-updater.

earwig avatar earwig commented on July 18, 2024

Something like this will work:

gitup . -e 'bash -c "git ls-remote --exit-code >/dev/null 2>&1 || (rm -rf $(git rev-parse --show-toplevel) && echo deleted)"'

Just keep in mind that it's inherently very dangerous if you are ever unable to access the remote for some reason.

from git-repo-updater.

Xaelias avatar Xaelias commented on July 18, 2024

At the very least you can check that the remote server answers on port 22 or 443 (depending on if you use ssh or https) by grepping the config in .git and testing with nc. Just to make sure it's not just the server being offline.
But if you want to try and get all the edge cases (ssh key not in the keychain/agent anymore, temporary access issue, etc. etc.) it's going to be real hard.
Also it doesn't sound fun working at a company that things having 500 git repos is a good idea :-D
You could have a process that "quarantine" these repos. Move them to a secondary folder you can recover them from. And then have a cron job that deletes them after x days based on mtime.

from git-repo-updater.

Shooter3k avatar Shooter3k commented on July 18, 2024

Ha. That's a creative approach. Thank you. I'm currently running gitup on a Windows machine so I'll install it on a unix machine and give this a shot. Thanks for taking the time to answer the question.

Something like this will work:

gitup . -e 'bash -c "git ls-remote --exit-code >/dev/null 2>&1 || (rm -rf $(git rev-parse --show-toplevel) && echo deleted)"'

Just keep in mind that it's inherently very dangerous if you are ever unable to access the remote for some reason.

from git-repo-updater.

jrcastine avatar jrcastine commented on July 18, 2024

gitup -n will clean up it's bookmarks file for repo's that are no longer there.

from git-repo-updater.

Related Issues (20)

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.