How to go from "published code as a wiki" back to "provisioned wiki"? - azure-devops

Have read about differences of the two here: https://learn.microsoft.com/en-us/azure/devops/project/wiki/provisioned-vs-published-wiki?view=azure-devops.
Would like to try out code as wiki, however, want to have a backup plan in case I want to switch back to the provisioned one.
Once I have tried the "published code as wiki" does anyone know how to import the contents from a repo backup and make it "provisioned one"?

If you have already created a project wiki and add a code wiki, the two wiki's will coexist (see screenshot):
If the Code wiki is not the way to go, you can unpublish it only leaving the project wiki in place.
If the Code wiki is the way to go, removing a provisioned (project) wiki doesn't seem to be an option in the UI. Still, there are options to Delete default project Wiki in Azure DevOps using the API.

As another solution said, you can unpublish the Code wiki if you want to keep the project wiki.
If you want to keep only the Code wiki then you can download the project wiki as a git repo and replace all content. After having pushed the new content you can delete the (old) Code wiki.
Editing history will be lost but that is hopefully not important to you.

Related

Azure DevOps project description page (a dynamic readMe file possible?)

I have seen some informative Azure DevOps Project description pages (readMe file), where one can see at a first glance how the whole project is performing and would like to do something similar and want to know from where the information is coming and how to keep it up to date with the latest build/deploy status?
Something I have in mind is similar to this. Especially those green / red labeled indicators, which are also found sometimes in some GitHub repository readMe pages
example 2:
The general idea is to setup a pipeline dedicated to update your README, as explained here.
This is illustrated in the official documentation "Add a status badge to your repository"

Delete Published Wiki

I created a code wiki. Worked nicely.
Decided to take a look at published wikis so added one and then found that it overrode the code wiki (wtf?)
Then I discover that I can't go back (double wtf?)
Eventually, after much faffing about I found this:
https://learn.microsoft.com/en-us/azure/devops/project/wiki/provisioned-vs-published-wiki?view=azure-devops#delete-project-wiki
Talk about a PITA, but it worked. This morning I look at the wiki again and the empty published wiki is back.
However, the above solution no longer works. Running "az devops wiki list" just shows the single codeWiki. No mention of the projectWiki and so, I have no repositoryId to call DELETE against.
So, two questions:
How do I get back to the codeWiki?
Has there been any indication of when MS are going to fix this ridiculous manual delete situation?
You can select your wikis here:
You can refer to the document if you want to delete your wiki pages:
Code wiki:Edit, rename, or delete pages
Project wiki:Edit and delete wiki pages

Disable zip downloads from github

Is there any way to disable viewers to download my files from github?
I want to show my work, but I am afraid anybody can steal my code.
You can't, Github actually means you want to share something with the community, or you are showcasing your work in the open source community. Unfortunately you cannot restrict the users from downloading your content from your Repository.
Alternatively what you can do Just make your Repository private. But then in this case you are not able to make you work available to view for audience.
More you can read here :-
https://help.github.com/en/github/building-a-strong-community/limiting-interactions-in-your-repository
Disabling zip/tarballs on GitHub at the moment seems to be impossible, but it would be useful for those using git submodules, which are not included in the automatic created archives, where the repository owner could replace them with a continuous integration job with something like git-archive-all.

Unedited files not showing up in repository?

Very new to Github and I downloaded the desktop application in hopes of understanding it better. What I'm trying to do is commit/push files by dragging them into my repository folder, but they don't show in application when moved? I tried editing a txt file and as soon as I save it, it appears. I don't want to have to edit every file I add to my repository as I edit it elsewhere. How do I make the non-edited, dragged-and-dropped files appear?
Also, is there an official GitHub support forum? I can't find anything on their website where you can ask questions/etc and I'm not sure StackOverflow is the best place for this question.
Thanks!
That's the way how git works. It doesn't make sense to add every time the unedited files.
When it notices you added/edited/removed files, git will know that.
I pasted a file (blocks.gif) in my repository and in GitHub Desktop it I see the following (click the 1 uncommitted change) and you should see the new files there. Then you can write a commit message and commit the changes.
Also, is there an official GitHub support forum?
When you need help using GitHub, you can always contact the support team (or write an email to support#github.com). They are awesome people. :)
https://github.com/contact

Programmatically add files to a GitHub download page

[[Please note that Github has changed a lot since this question was first asked; instead of "download page" read "new release".]]
I generate PDF documentation as part of my projects and I'd like them to stay in sync with my Git repository (it's not always possible for people to build their own since they often use proprietary fonts).
However, it's not really "correct" to add the PDFs to the repository since it's a derived file; furthermore, doing this adds significantly to the size of the commits and the size of the repository overall.
Is it possible to programmatically send files to the GitHub download page? (I know that tagged commits are automatically added there with git push --tags but I don't know where this is documented. I suppose I could do something fancy by adding a separate branch only containing the PDFs themselves — as done by the GitHub user pages — but I'm a bit rusty on using Git this way.)
Github API v3 supports this feature.
GitHub also provides a maven plugin based on the java API that is part of the Eclipse Mylyn connector for GitHub.
There is a ruby gem called github_api.
The other answer talks about net-github-upload which is available for perl and ruby.
check out for net-github-upload which is available
for perl: http://github.com/typester/net-github-upload-perl
and ruby: http://github.com/Constellation/ruby-net-github-upload
With that you can write a small script to upload and update your PDF easily. To sad there's no easy way provided by github guys themselves..
cheer!
The GitHub blog post announcing that this feature has been disabled: https://github.com/blog/1302-goodbye-uploads
I take it that by "GitHub download page", the owner means a repo–more specifically a branch– that can be downloaded via the "download" button.
If you want to add a file to a repo using the API, you will have to become familiar with the process described here: https://developer.github.com/v3/git/
It's not the easiest process in the world, but mastering it will force you to understand the concepts of blobs, trees, commits and references, amongst others.
You can't just "send a file" to a repo because you're working with Git, and Git has some "internal expectations" that you just can't ignore (it's impossible to think of GitHub as some sort of host that you can ftp). Explaining the flow required to create a file in a GitHub repo is certainly beyond the scope of the original question, but to provide a clear answer: no, it's not possible to programmatically upload a file on GitHub, but yes it is possible to programmatically push a file on GitHub".
There's a PHP library named GitHubTreePHP that lets you automate the process (Disclaimer: I wrote it).