Giter VIP home page Giter VIP logo

egghead-practical-git's Introduction

Practical Git for Everyday Professional Use

egghead.io course by Trevor Miller.

git pull

// is the same as:
git fetch
git merge

Create and checkout branch at the same time using -b command:

git checkout -b branch-name

Switch to the last branch accessed:

git checkout -

Less editor git log

  • use forward slash / to search log
  • press q to exit editor
  • navigate using up/down page keys
  • navigate using j or k keys or d and b for paging up and down

Pass arguments to git log

// condense commits to a single line
git log --oneline

// show changes
git log -p

// show additions and deletions
git log --stat

// filter by latest commits (show last 3)
git log -3

// filter by dates
// sometimes used as since / until which are aliases to after and before respectively
git log --after="yesterday"
git log --after="3/15/16" --before="yesterday"

Git blame tells us who modified the file, line by line.

Return repository to the state in which rebase was started

git rebase --abort

Interactive rebase (squash, pick, change commits)

git rebase -i origin/master

Add global git configuration options

git config --global
git config --global user.name 'Lyndsey Browning'
git config --global core.editor atom
git config --global alias.graph 'log --graph --oneline'
git config --list

Output contents of gitconfig file

cat ~/.gitconfig

If we add a .gitignore after we've started tracking files, we can use the following command to clear the git cache to remove the tracked files.

git rm --cached

egghead-practical-git's People

Contributors

lyndseybrowning avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.