Add gitconfig

This commit is contained in:
Alban Bronisz 2021-08-31 16:19:12 +02:00
parent 4b10eb4fbc
commit 0513d26fc5
3 changed files with 102 additions and 10 deletions

61
.gitconfig Normal file
View File

@ -0,0 +1,61 @@
[user]
name = Alban Bronisz
email = alban.bronisz@probayes.com
[push]
# Only push current branch
default = simple
[alias]
# The full history
hist = log --pretty='%h %ad | %s%d [%an]' --graph --date=short
# A short history, can be longer using for instance git h -20
h = log --pretty='%h %ad | %s%d [%an]' --graph --date=short -5
ignore = update-index --assume-unchanged
ignored = !git ls-files -v | grep ^[[:lower:]]
s = status
b = branch -avv
a = add -A -p
aw = -c interactive.diffFilter=\"git diff --color-words\" add -A -p
#staged ---------------------------------
# ^ | ^
# | | |
# | git a | git rs |
# | v |
#not staged ----------------------------- |git ds
# ^ | | ^
# | | | | git d
# | git add xx | git r | |
# | v v v
#unmodified -----------------------------
# ^ |
# | |
# | git sp | git ss
# | v
#stash -----------------------------
# usage: git co "commit message"
co = commit -m
deco = reset --soft HEAD^
# d=diff (s=staged)
d = diff
ds = diff --cached
# r=restore (s=staged)
r = restore -p
rs = restore -p --staged
# s=stash (save/list/pop)
ss = stash save
sl = stash list
sp = stash pop
# c=config (global/edit)
cg = config --global --edit
cl = config --local --edit
[core]
excludesfile = /home/abronisz/.gitignore_global
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[pull]
# Only pull if fast forward, otherwise need to use pull --rebase (to avoid pull merge)
ff = only

9
README.md Normal file
View File

@ -0,0 +1,9 @@
A DevOps Wiki
=============
- [Byobu](byobu.md): a command line tools to use on server (detach term, multi screen...)
- [General commandes](commandes.md): like pdf, images
- [Docker](docker.md)
- [Git](git.md)

View File

@ -1,24 +1,29 @@
Some tips for Gitlab
====================
Git
===
CI Variables
------------
- [Predefined Variables](https://docs.gitlab.com/ee/ci/variables/predefined_variables.html)
- one can also add CI variables to a group: `Settings` > `CI/CD`, `Variables` section
For aliases and config, see my [.gitconfig](.gitconfig) (self documented)
To update to new git version
sudo add-apt-repository ppa:git-core/ppa
sudo apt update
sudo install git
Use branches :
- better separation on work in progress
- can use `push --force` and even a deep git functionnality: squash
- to be able to push/pull even outside of the Probayes VPN, use url like:
ssh://git@code.probayes.net:28129/
Use `git --amend`
Miscellaneous
=============
Git workflow
------------
Git workflows
-------------
### Git flow
develop/master
@ -38,3 +43,20 @@ que master
### Gitlab flow
Ajoute un branch production (et même release ou encore pre-prod)
Some tips for Gitlab
====================
CI Variables
------------
- [Predefined Variables](https://docs.gitlab.com/ee/ci/variables/predefined_variables.html)
- one can also add CI variables to a group: `Settings` > `CI/CD`, `Variables` section
- to be able to push/pull even outside of the Probayes VPN, use url like:
ssh://git@code.probayes.net:28129/