I have a bare repo on remote location with some configs I'd like to share with everyone who clones it. Is it possible? Every time I clone, it seems to revert everything in .git/config
to defaults and just add information about remote repo.
To Git clone a repository navigate to your preferred repository hosting service like GitHub, select the repository you want to clone, copy the repository URL via HTTPS or SSH, type git clone in the command line, paste the URL, and hit enter .
In order to clone a specific branch, you have to execute “git branch” with the “-b” and specify the branch you want to clone. $ git clone -b dev https://github.com/username/project.git Cloning into 'project'... remote: Enumerating objects: 813, done.
When you clone a repository with git clone , it automatically creates a remote connection called origin pointing back to the cloned repository. This is useful for developers creating a local copy of a central repository, since it provides an easy way to pull upstream changes or publish local commits.
No, unless you clone the repo and add the local machine info in commit message, and then push to remote, so that the remote knows this local machine cloned this repo.
I confirm a local config (the one within .git/config
) is never shared amongst repo
(for various security reasons, like, for instance,:
github.token
) supposed to be secret and incorrectly entered in the local config instead of the global oneuser.name
and user.email
(which can be set on a local level if those differs from other repos): that wouldn't make sense to propagate my name and email when other clone my repo.The closest way to do that would be to version an actual file with the config in it, and invite users to copy it in their .git/config
file
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