I found the steps to rename a github repository. My question is whether I could rename it and then change the name back to the original name. I read that github will do some redirects, so I was concerned before doing it that it would not allow me to rename it back to its original name.
Here is my scenario: I'm have a course that has an associated github repository. People are currently watching the course and need access to the github repository with the current name.
I am working on an update to the course which has a slightly revised name and hence I want to rename the github repo. For today, I want a screen shot of the newly named repo. But I can't officially (and permanently) change the name until the updated course is done and ready to go live.
No, GitHub will not block you from changing the name of the repository back to what it was previously if you have to temporarily change it like this.
I just tested it myself, was able to rename my repo right back to how it was previously.
Related
I would like to provide a URL to a subfolder of a GitHub repo in a paper I am about to submit. I thought the link should look like github.com/account/reponame/folder/subfolder, but I realised now that when navigating through the repo, I need to write github.com/account/reponame/tree/main/folder/subfolder for the link to work. Can I assume a link with this format to be persistent, or is there a better way of ensuring that the URL is useful for a long time?
the /tree/master/ just indicates the master branch is being accessed. The link would be active till someone with edit access to the repo changes the folder structure or deletes it. If it is a repo with shared edit access, I would suggest you to fork it and make it private and then share the link from the fork so that no one would make changes to the path other than you.
It is safer to refer to a specific commit, that is:
github.com/account/reponame/tree/COMMITID/main/folder/subfolder
Where COMMITID is the SHA hash of your commit, which should look like 56e05fced214c44a37759efa2dfc25a65d8ae98d
That way, you can still push changes to your repo, and the reviewers still will get access to the specific version you want.
I see this message below my repo name. Is there any way to remove it? I used template for my app for a quick start, but in current form my app doesn't look like this template, because everything changed so much. I don't see any reason why it's still there.
I had the same problem and at the time for writing this answer, there is no option of removing this from Github. So removed this tag by deleting the repository from Github and recreating a new one with the same name.
⚠️ This operation will preserve only the information stored in git, not all other Github features, i.e. issues, PRs, ... If your repository has been used for a while, this might not be the right time to do this anymore.
Specific instructions:
Make sure you have cloned your repository and all your non-stale branches are saved locally.
git fetch
Delete the original repository in the Github web UI.
Create a new repository with the same name.
Push the branches you want back to the remote.
git push
I feel like this question must have been asked before, but I'm not finding it on here. I have a file that I want in a GitHub repo, in this case a file in which the user would paste their API keys after cloning. I want this blank file to be cloned down, but I don't want it to be tracked or pushed. I already have it listed in the .gitignore file that is contained in the repo, yet after pulling and modifying the file, git status still shows the file as being tracked and having changes that need to be committed. How can I get around this?
You could do something like this via Github Enterprise's pre-receive hooks functionality.
From the readme, you can create a pre-receive hook that:
Prevents sensitive data from being added to the repository by blocking keywords, patterns or filetypes.
Through the github web interface I created a new repository. I forgot to chose some options at creation time and thought I'd delete the new, empty repository and start again.
I deleted the repository but now cannot create a new repository with the same name as one that was deleted. I get a 'Name already exists on this account' error when I try.
I don't know if this is a permanent matter (i.e. I can never create a new repository named the same as one that has been deleted) or just a temporary matter perhaps due to some information being cached which will later be cleared.
Can I create a github repository named the same as one that existed but was deleted?
You certainly should be able to create a new one with the same name. I'm fairly sure I've done this before.
I'd leave it for 5/10 minutes and try again if I were you.
I faced this dilemma. But then I noticed I can rename a repo and then create a new repo with the old name, and in case there is a problem creating one with the old name, just rename the old one again...
So no need to delete the repo...
I was having a similar issue, using the Web interface, where the new repo creation page was saying the repo name was available, but I couldn't click the 'Create Repository' button. I opened the developer tools and removed the disabled attribute on the button. clicked again, and it just worked; could have tried to wait a bit and Ctrl+refresh the page, but I didn't want to loose the repository settings...
If you are having this problem within the client interface (namely, the Windows client), you can refresh your repo list. Once the repo in question disappears from the list, you should have no problem creating the new repo with the same name.
I figured this one out. When you create a repo be sure the "publish to GitHub" is UNCHECKED. The problem is that it's trying to create a new repo on GitHub with the same name as the one you previously created there.
You should also consider going into your GitHub control panel and delete your old repo if it's not holding any information of value.
I just started using github.com and my friend and I are working on a project. How can I pull parts of the project but check out certain files I'm working on so he doesn't work on them. He can still download the files but he won't be able to open or edit them until I upload them back and give permission?
I suppose you mean lock a file when you edit it. Git won't let you do this and it's not something you need to worry about. Instead, you can both work on the same file and then merge your changes later.
If you really want to work that way (i.e: lock files, or at least control when your friend will modify your repo), you can ask your friend to fork your repo.
That way, he/she:
will have his/her own copy of said repo
will work on any file
will rebase first with branches fetched from your repo (added as a remote on his/her fork, as described in GitHub: working with remotes)
will make pull request, allowing to decide what to include and when.
Historically version control systems provide a checkin/checkout feature. When you do a checkout, you reserve the artifact. If another person also has the same file checked out, then you get an error when trying to checkin the artifact. Not sure creating another fork is really the equivale