Some Git help

I shared some information at a Lunch and Learn along with a demo and now I’m sharing it with you.

"branching as a tool vs branching as a strategy" ~ Scott a branch is a playground

new task = new branch, use Pull Requests to get the code into master - or allow direct check-in to master (for 1 or 2 person teams?) checkout a branch with git checkout myBranch

from VS UI VS Code UI

#taskNumber in comment will link up to a TFS task.

Pull Request - gated - code reviews  

Command Line get latest = git pull check in = git add -A (stage), commit -m "commit message" (repeat), git push git checkout is switching the branch

Rebasing git checkout master git pull

git checkout myBranch git rebase master git push --force // VS doesn't do this

git..master karma.conf.js (compare your branched code against master)

rebase or merge? http://stackoverflow.com/questions/804115/when-do-you-use-git-rebase-instead-of-git-merge

VIM http://bullium.com/support/vim.html get away from VIM: https://help.github.com/articles/associating-text-editors-with-git/ http://stackoverflow.com/questions/30024353/how-to-use-visual-studio-code-as-default-editor-for-git   

Links

http://learngitbranching.js.org/ https://www.codeschool.com/courses/try-git https://www.visualstudio.com/en-us/docs/git/gitquickstart https://git-scm.com/book/en/v2 https://www.pluralsight.com/courses/git-fundamentals https://blogs.msdn.microsoft.com/luisdem/2016/10/18/net-core-git-vsts-vscode/

XKCD is relevant here: https://imgs.xkcd.com/comics/git.png

!(https://imgs.xkcd.com/comics/git.png)

This article is part of the GWB Archives. Original Author: Aligned

New on Geeks with Blogs

  • We Won The One Award I Actually Care About

    Full Scale made the Inc. 5000 for the fifth year straight, the 12th listing across my three companies. Here is why the one award you cannot buy is worth stopping for.

  • Your Customers Build the Features Now

    I let a tool I liked sit dead for a year rather than build the features I wanted. An MCP server meant I never had to, and your customers can do the same to your product.

  • Get the Size of a Directory in Linux the Easy Way

    du -sh for the quick answer, ncdu for the cleanup, df for the disk itself: every command for checking directory size in Linux, plus why du and df never agree.

  • Vim Search and Replace: The Ultimate Guide

    One :%s command replaces every match in a file before a find dialog would even open. The Vim substitute patterns worth the muscle memory: flags, ranges, capture groups, and multi-file edits.