update(order)
This commit is contained in:
commit
7bd1ff1774
|
|
@ -0,0 +1,67 @@
|
||||||
|
# Git Config
|
||||||
|
|
||||||
|
## Git
|
||||||
|
|
||||||
|
### Install && Config
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install git
|
||||||
|
```
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo adduser \
|
||||||
|
--system \
|
||||||
|
--shell /bin/bash \
|
||||||
|
--gecos "Git Version Control" \
|
||||||
|
--group \
|
||||||
|
--disabled-password \
|
||||||
|
--home /home/git \
|
||||||
|
git
|
||||||
|
```
|
||||||
|
|
||||||
|
## SSH
|
||||||
|
|
||||||
|
### Install && Config
|
||||||
|
|
||||||
|
#### Linux
|
||||||
|
|
||||||
|
install
|
||||||
|
```sh
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install git
|
||||||
|
sudo apt install openssh-client
|
||||||
|
```
|
||||||
|
|
||||||
|
config
|
||||||
|
```sh
|
||||||
|
ssh-keygen -t ed25519 -C "name@ssh.local"
|
||||||
|
```
|
||||||
|
|
||||||
|
copy and paste
|
||||||
|
```sh
|
||||||
|
cat ~/.ssh/id_ed25519.pub
|
||||||
|
```
|
||||||
|
|
||||||
|
copy to server
|
||||||
|
|
||||||
|
```sh
|
||||||
|
ssh-copy-id -p 22 root@<ip>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Error`s
|
||||||
|
|
||||||
|
### SSH key
|
||||||
|
```
|
||||||
|
Cloning into '<repo>'...
|
||||||
|
repo@repo.local: Permission denied (publickey).
|
||||||
|
fatal: Could not read from remote repository.
|
||||||
|
|
||||||
|
Please make sure you have the correct access rights
|
||||||
|
and the repository exists.
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
cat ~/.ssh/id_ed25519.pub
|
||||||
|
```
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
# .gitattributes
|
||||||
|
|
||||||
|
`.gitattributes`
|
||||||
|
```text
|
||||||
|
*.png filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.jpg filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||||
|
```
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
# Branch
|
||||||
|
|
||||||
|
## Create
|
||||||
|
```sh
|
||||||
|
git branch
|
||||||
|
git branch new_branch
|
||||||
|
```
|
||||||
|
|
||||||
|
## Switch
|
||||||
|
```sh
|
||||||
|
git switch main
|
||||||
|
git checkout main
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Create and switch
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git switch -c main
|
||||||
|
git checkout -b main
|
||||||
|
```
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
# Clone
|
||||||
|
|
||||||
|
|
||||||
|
## SSH
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git clone ssh://
|
||||||
|
```
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
# Config
|
||||||
|
|
||||||
|
|
||||||
|
## Windows
|
||||||
|
```sh
|
||||||
|
git config --global core.autocrlf input
|
||||||
|
git config --global core.eol lf
|
||||||
|
```
|
||||||
|
|
||||||
|
## Username && Mail
|
||||||
|
```sh
|
||||||
|
git config --global user.email "tuz@mail.local"
|
||||||
|
git config --global user.name "tuz"
|
||||||
|
|
||||||
|
git config --global user.name "unknown"
|
||||||
|
git config --global user.email "unknown@mail.local"
|
||||||
|
|
||||||
|
git config --global user.email "name@mail.local"
|
||||||
|
git config --global user.name "name"
|
||||||
|
|
||||||
|
```
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
// Delete local branch
|
||||||
|
git branch -d main
|
||||||
|
git branch -D main
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
# git-lfs
|
||||||
|
|
||||||
|
|
||||||
|
## Install
|
||||||
|
sudo apt install git-lfs
|
||||||
|
git lfs Install
|
||||||
|
|
||||||
|
|
||||||
|
## GIT track file types
|
||||||
|
```
|
||||||
|
git lfs track "*.png"
|
||||||
|
git lfs track "*.jpg"
|
||||||
|
git lfs track "*.mp4"
|
||||||
|
git lfs track "*.zip"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Commit Config LFS
|
||||||
|
```
|
||||||
|
git add .gitattributes
|
||||||
|
git commit -m "Enable Git LFS"
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Track images
|
||||||
|
*.png filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.jpg filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gif filter=lfs diff=lfs merge=lfs -text
|
||||||
|
|
||||||
|
# Track video
|
||||||
|
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
|
||||||
|
# Track design files
|
||||||
|
*.psd filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.svg filter=lfs diff=lfs merge=lfs -text
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
all:
|
||||||
|
git add -A
|
||||||
|
git commit -m "Update"
|
||||||
|
git push -u origin main
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
|
||||||
|
git config --global --add safe.directory "C:/Users/user/source/repo"
|
||||||
|
|
||||||
|
git config --global --add safe.directory "C:/Users/user/*"
|
||||||
|
|
||||||
|
|
||||||
|
git status
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
# Remote
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git remote -v
|
||||||
|
git remote set-url origin
|
||||||
|
git remote set-url origin ssh://git@gitea.com:<port>/[user]/git.git
|
||||||
|
```
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
# Show
|
||||||
|
|
||||||
|
git branch -a
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
|
||||||
|
# SSH
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cat ~/.ssh/id_ed25519.pub
|
||||||
|
```
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
# Status
|
||||||
|
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git status
|
||||||
|
```
|
||||||
Loading…
Reference in New Issue