Best practice for cloning and committing a Wiki repo for a BitBucket project

In BitBucket, you can create a Wiki for a project. However, the Wiki itself is a repo that is separate from the original repo. When you clone it, it creates a repo called "wiki".

Where is the ideal or usual place to clone this repo? Do you put it in the original repo? If so, do you do .gitignore / wiki when migrating from the source repo? Or do you include the wiki repository in the original repo?

When clicked, you commit twice, once in the original repo, and then again in the replica wiki? Or can you modify the git source to commit both the source and the wiki?

Thanks.

+6
source share
2 answers

The ideal way is to use the Git submodule function:

$ cd project $ git submodule add https://bitbucket.org/user/project.git/wiki 

This creates a wiki and .gitmodules , and then:

 $ cd wiki $ nano Home.md 

Change some of the information in the file and:

 $ git add . $ git commit -m "Some comment" $ git push origin master 

Return to the project:

 $ cd .. $ git add . $ git commit -m "Added wiki module" $ git push [remoteName] [remoteBranch] 

In this case, the repo project will generate a link to a specific commit of the wiki repo, you can update both only one of them.

I hope this will be helpful.

Additional information: https://git-scm.com/book/en/v2/Git-Tools-Submodules

+4
source

I keep the following structure for repositories.

enter image description here

The idea is to maintain the code repo and related wiki as siblings. Thus, there is no need to tell .gitignore to ignore any wiki related files. In addition, you only click on the repo where you make changes. Hope this is what you were looking for.

+1
source

All Articles