How to find the new location of a repository after a rename

St. John Johnson

If a user renames a repository from foo/bar.git to foo/baz.git via GitHub's UI, how can I detect this via the API?

Currently, I get a 404 if I call the API like this:

GET /repos/foo/bar

How can I find the new repository name?

Ian Stapleton Cordasco

So GitHub does not expose renames through the API.

UPDATE: that is no longer true and this answer is out of date; the API has exposed renames since July 2015.

Given the constraints of your question (i.e., just the repository name has changed, not the user/organization) you could rely on the repository ID.

If you have information about the repo before it was renamed, you should have the id which is returned by the API. If you do then to have a resilient access to the repository, you just need to do

GET /repositories/1234

And you'll always get the repository, regardless of whether the name changes (assuming you still have access to it).

A better example, is to do

GET https://api.github.com/repositories/1234

(or whatever your GitHub enterprise instance is).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to rename a snapshot repository in elasticsearch?

From Dev

How to rename a local APT repository?

From Dev

Find location of NEW number in list

From Dev

How to rename multiple filenames using find/rename

From Java

In a Git repository, how to properly rename a directory?

From Java

How do I rename a Git repository?

From Java

Docker how to change repository name or rename image?

From Dev

How to rename domain and git repository in Cloudbees?

From Dev

Find, rename and copy files to a new directory

From Dev

How do Insert / Save new file name after rename to my database?

From Dev

New Ubuntu user: What is the repository? How do I access it? How do I find and use WINE?

From Dev

Repository Location

From Dev

Repository Location

From Dev

SVN Log After Loading Dump Into New Repository

From Dev

Error This repository moved. Please use the new location

From Dev

Repository content (files/directories) not showing at new location on svn dump and load

From Dev

How to create a new repository with PyGithub

From Dev

which are the ways to find new files in a server location

From Dev

How to restore object repository after adding a new project type when getting "Invalid image size" error?

From Dev

How to find location of installed library

From Dev

How to find a module's location

From Dev

How to find Private Key Location

From Dev

How to find location of installed library

From Dev

how to find location of Id in NSMutableArray

From Dev

How to find all users that are in a location

From Dev

How to get location after updates?

From Dev

How to get location after updates?

From Dev

How to rename multiple files using find

From Dev

How to rename a file using find command

Related Related

HotTag

Archive