Setting up a Git Repository


This is one of a series of posts where I document software configurations for personal reference. This post documents the configurations for setting up a git repository.

User information

git config --global 'zenggyu'
git config --local 'zenggyu@<domain_name>'

Http proxy setting

git config --local http.proxy 'http://[user:password@]host:port'

File name display

git config --global core.quotepath off

With this setting, file names that contain CJK characters will be displayed as is by commands that output paths (e.g., git status).


git config --global core.autocrlf input
git config --global core.safecrlf true

With core.autocrlf input, Git auto converts CRLF (which is the default line ending type for windows) line endings into LF (which is the default line ending type for *nix) when you add a file to the index, and vice versa when it checks out code onto your filesystem. Note that core.autocrlf input is the recommended setting for cross-platform setting on *nix machines. On windows machines, set core.autocrlf true instead.

With core.safecrlf true, Git checks if converting CRLF in a file is reversible and rejects the commit if it is not. See the documentation for more details.

Create a Gitlab repo using command line

git push --set-upstream<project_name>.git master


comments powered by Disqus