Skip to content

Wiki Bulk Edit Git

Megan Lohnash edited this page Jun 24, 2020 · 9 revisions

Working With Git to Bulk Edit/Add Pages to This Wiki

This California Revealed Administrative-Documentation Wiki is maintained on the carevealed github website.

Using Command-line Git commands, one may download the entire wiki to a local computer for editing and creating new pages.

Prerequisites

Setup a local folder for the Wiki

  • Create a top level folder for the wiki docs
  • Navigate to this folder in the command line or console
  • user the cd command to "change directory" to this folder
  • Inside the folder run the following command: git clone https://github.com/carevealed/Administrative-Documentation.wiki.git
  • Git will now clone the files and directory structure of the wiki inside your new local folder.

Editing Files on Your Local computer

  • The files are text files in the "Markdown" format so they all have the ".md" file extension.
  • Any text editor will work for editing the docs, but a 'smart' editor like Atom will allow you to preview the Markdown formatting which is quite handy.
  • Atom will also allow you to open the entire wiki folder as a "Project Folder" and displays all the files with color coding to indicate their git status.
  • Images are a bit tricky - it's easiest to copy paste the image embed code from another page and change the file name and alt-text.
  • Use Pandoc to transform docx files into md files. Helpful page here: https://www.epiphanydigest.com/2020/06/12/how-to-convert-a-word-document-to-markdown-format/

Procedure for working on local wiki Files

Ensure Local is in Sync with Github

  • Before doing any work on the local, check to make sure it is in sync with the github version - this is important in case edits have been made online since the last time you sync'd your Local note: if you have edits on your local that are not yet uploaded to github then skip this step.
  • In your Command Line - go to the wiki folder (the one called Administrative-Documentation.wiki created by the original git clone)
  • enter git status
  • If your local is up-to-date you will see a message like On branch master. Your branch is up to date with 'origin/master'. nothing to commit, working tree clean.
  • If not then you will need to pull a fresh copy from github to your Local
    • enter git pull - this will show status as it pulls a fresh copy
    • run git status again to confirm that you are in sync

Upload Edited and New files

Once you have made some changes to the files on your local, it's time to upload them to github. This process has three steps - add the files to the git queue, commit the file(s) to the github repository, and push the files up to the github server.

  • In your Command Line - go to the wiki folder (the one called Administrative-Documentation.wiki created by the original git clone)
  • enter git add . (note the space and period after "add")
  • this will add all your changes to the subqueue
  • enter git commit -m "message goes here" (in place of "message goes here" add a note for yourself and other users so we know what you changed e.g. "adding help link to all pages"
  • enter git push origin master - if there are many changes and/or new pages this may take a minute to complete.
  • enter git status just to make sure all is well.

Clone this wiki locally