1

My intention is to clone a repository from github, make some changes to it and then store it on my company's bitbucket server along with its submodule repositories. I am not sure what is the proper way to do this since the submodule pointer inside the main git repository also point to github website.

The first thing I noticed is that, all the repositories cloned from my bit bucket have a .git folder inside. But, the repositories cloned from github contain a .github folder. Why is this so? Aren't they both git repositories basically?

What is the proper way to take the main repository and its submodules and put then on my local bit bucket server so I can always use them from there? This is also important so I can stay away from the hell of SSL certificates and firewalls of my employer.

How do I change the remote of the repositories to my local bitbucket server yet at the same time have the capability to pull changes from github?

1

1 Answer 1

1

The .github folder you see in the repositories you clone from GitHub is not a special folder to Git, but instead a location in which you can place certain GitHub-specific files, such as GitHub Actions workflows or issue templates. A Git repository you clone there should also have a normal .git folder as well.

There are two ways you can change the submodule location. The first is to modify the .gitmodules file to point to the new location and commit. The other is to have each developer use the url.<base>.insteadOf option defined in the git-config(1) manual page to rewrite the old URLs into the new URLs. The former would be much easier, so it's what I would recommend.

You should otherwise be able to just clone the repository from one location and push it to the other. You may wish to use the --mirror option to clone all branches and tags, however.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .