Configuring Git As you saw in getting started, Git can be configured using Git config. The first thing to do is set your name and email address:
git config –global user.name “John Doe” git config –global user.email ‘[email protected]’ git config –global alias.a add git config –global alias.commit c git config –global alias.status s git config –global alias.log l git config Core.ignorecase true ignores the case of the file name
Git config –list gitconfig –list gitconfig –list gitconfig –list Windows can be found in the.gitconfig file at C: Users\Administrator\.
If you want to modify the configuration, follow the command above and press Enter
–global — git — git — git — git — git — git — git — git — git — git — git
.gitignore
MTK / — — — — — — — — — — — — — — — — — — — — — — — — — – > filter entire folders. Zip — — — — — — — — — — — — — — — — — — — — — — — — — – > filter all. Zip file/MTK/do. ————————–> Filter a specific file! SRC / ————————–> Do not filter this folder! .zip ————————–> Do not filter all. Zip files! / MTK /do.c ————————–> Do not filter the file
Directories begin with a slash /; Wildcard multiple characters with asterisk *; On the question mark? Wildcard single character contains a list of matches for a single character in square brackets []; In order to exclamation point! It does not ignore (trace) matched files or directories.
Git matches the.ignore configuration file from top to bottom, meaning that if the previous rule matches a larger range, the later rule will not take effect, and git will not track if there is an empty folder in git.
System Configuration Definition
The window user can modify the ~/. Bashrc or ~/. Bash_profile file.
ZSHRC file to define common alias directives. Alias gs=”git status” alias gc=”git commit -m “alias gl=”git log –graph –pretty=format:’%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset’ –abbrev-commit ” alias gb=”git branch” alias ga=”git add .” alias go=”git checkout”
Git key
Key generation Generate a secret key: ssh-keygen -t rsa -c “[email protected]”, Enter directly, and then the system prompts you to Enter the password (optional). SSH file will be generated in C:\Users[username]. SSH directory. Two files are generated in.ssh: a private key (ID_rsa) and a public key (id_rsa.pub). The private key is kept on your computer and the public key is given to the project leader for addition to the server. A user must have a private key paired with the server’s public key to access the code base on the server. 1. Go to Github homepage: github.com/. If you don’t already have a Github account, sign up for one. After login, click on your profile picture in the upper right corner, go to Settings, click SSH and GPG Keys on the left, and then New SSH Keys
You can fill in any Title, and then what you need to fill in for key is id_rsa.pub in.ssh, open it with text, assign the whole thing, and paste it into key 3. After filling in the Title and Key, click Add SSH Key
Github automatically deploys