In BitBucket, you can create a Wiki for a project. However, the Wiki itself is a repo that is separate from the source repo. When you clone it, it creates a repo with the name "wiki".
Where is the ideal or conventional place to clone this repo? Do you put it inside the source repo? If so, do you .gitignore /wiki when committing from the source repo? Or do you include the wiki repo in the source repo?
When pushing, do you commit twice, once in the source repo and then again in the wiki repo? Or can you modify the source's git to commit both the source and the wiki?
Thank you.
The ideal way is using submodule function of Git:
$ cd project
$ git submodule add https://bitbucket.org/user/project.git/wiki
This creates a folder wiki
and .gitmodules
file, then:
$ cd wiki
$ nano Home.md
Change something of info in the file, and:
$ git add .
$ git commit -m "Some comment"
$ git push origin master
Returning to project:
$ cd ..
$ git add .
$ git commit -m "Added wiki module"
$ git push [remoteName] [remoteBranch]
With this the project repo will generate a link a specific commit of wiki repo, you can update both o only one of them.
I hope this is helpful.
More info: https://git-scm.com/book/en/v2/Git-Tools-Submodules
I maintain following structure for repositories.
The Idea is to maintain code repo and it's related wiki as siblings. This way there is no need to tell .gitignore to ignore any wiki related files. Also, you only push to the repo where you are making changes. Hope, this is what you were looking for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With