cd repo_directory
git config --get remote.origin.url
to check the remote URL
git config -e --local
check/update the [remote "origin"]
section
git config -e --global
check/update the [user]
and [http]
section
**Given the fact that you are using colab, in order to check your git configurations file , just use ! cat ~/.gitconfig
for --global , ! cat <repo_directory>/.git/config
for --local.
**In order to write your desired configuration files, use the %%shell
cmd in a new cell, e.g for <repo>/.git/config
same can be applied for ~/.gitconfig
:
%%shell
cat <<EOF >> <repo>/.git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = https://github.com/<user>/<repo>.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
EOF
--local
By default, git config will write to a local level if no configuration option is passed. Local level configuration is applied to the context repository git config gets invoked in. Local configuration values are stored in a file that can be found in the repo's .git directory: .git/config
--global
Global level configuration is user-specific, meaning it is applied to an operating system user. Global configuration values are stored in a file that is located in a user's home directory. ~ /.gitconfig on unix systems and