Skip to content

productiveio/git-workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Git Workshop

by Stjepan Hadjić

Read this readme carefully before we start.

Clone this repository and enjoy!

Config

Example:

; ~/.gitconfig
[core]
  excludesfile = /Users/stef/.gitignore
  editor = nvim
  ; editor = code -w
  ; editor = atom -w
  ignorecase = false
  pager = diff-so-fancy | less --tabs=4 -RFX
[init]
  defaultBranch = master
[push]
  default = current
  autoSetupRemote = true
[pull]
  rebase = true
[rebase]
  autoStash = true
  autosquash = true
[rerere]
  enabled = true

Aliases

Log

git-log

$ git log --topo-order
$ git log --topo-order --stat --patch --full-diff
$ git log --topo-order --graph

Task

Task instructions: task.md

Stage hunks/lines

In terminal

In VScode

In Intellij

Push

To push current branch to remote and setup upstream tracking:

Without config

$ git push --set-upstream origin feature_branch

with push.default = current

$ git push --set-upstream

with push.default = current and push.autoSetupRemote = true

$ git push

Pull

  • runs git fetch
  • if current branch is behind remote, it will fast-forward
  • if branches are diverged, it will rebase or merge depending on config

Fast-forward

Merge

Squash and merge (github)

Rebase

Rebase

$ git rebase --interactive {commit/branch}
$ git rebase --abort
$ git rebase --continue
$ git rebase --skip

Merge Conflics

Additional

$ git reflog

LazyGit Sign with 1password

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5