Showing posts with label GIT. Show all posts
Showing posts with label GIT. Show all posts

Saturday, 3 December 2016

Git command reference

Git reference docs: Click here
Download Git cheat sheet PDF

Git Cheat sheet-2

Git Cheat sheet-1

Git visual guide

Basic Usage

The four commands above copy files between the working directory, the stage (also called the index), and the history (in the form of commits).
  • git add files copies files (at their current state) to the stage.
  • git commit saves a snapshot of the stage as a commit.
  • git reset -- files unstages files; that is, it copies files from the latest commit to the stage. Use this command to "undo" a git add files. You can also git reset to unstage everything.
  • git checkout -- files copies files from the stage to the working directory. Use this to throw away local changes.
You can use git reset -pgit checkout -p, or git add -p instead of (or in addition to) specifying particular files to interactively choose which hunks copy.

Read More

Merge child branch with master

Merge master into the development first so that if there are any conflicts, I can resolve in the development branch itself and my master remains clean.

(on branch child)$ git merge master
(resolve any merge conflicts if there are any)
$ git checkout master
$ git merge child(there won't be any conflicts now)