diff --git a/.gitconfig b/.gitconfig new file mode 100644 index 0000000..b39e7bf --- /dev/null +++ b/.gitconfig @@ -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 + diff --git a/README.md b/README.md new file mode 100644 index 0000000..480bd51 --- /dev/null +++ b/README.md @@ -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) + diff --git a/gitlab.md b/git.md similarity index 74% rename from gitlab.md rename to git.md index a066c7d..d60a847 100644 --- a/gitlab.md +++ b/git.md @@ -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/ + +