LAB MANUAL GIT BY PRATIK JAIN. To start with git bash, we need to authenticate ourselves so that for every commit, git can use this information.

Similar documents
Computer Science Design I Version Control with Git

Version Control with GIT

GIT FOR SYSTEM ADMINS JUSTIN ELLIOTT PENN STATE UNIVERSITY

Submitting your Work using GIT

1. Git. Robert Snapp

git commit --amend git rebase <base> git reflog git checkout -b Create and check out a new branch named <branch>. Drop the -b

Version control with Git.

6 Git & Modularization

GIT. CS 490MT/5555, Spring 2017, Yongjie Zheng

! #Running this command from the top directory of your project will add all your changes."! $ git add."

Git Guide. Meher Krishna Patel. Created on : Octorber, 2017 Last updated : October, More documents are freely available at PythonDSP

Intermediate Programming, Spring Misha Kazhdan

Assumptions. GIT Commands. OS Commands

2 Initialize a git repository on your machine, add a README file, commit and push

CS 390 Software Engineering Lecture 4 - Git

GUIDE TO MAKE A REAL CONTRIBUTION TO AN OPEN SOURCE PROJECT 1. 1

Introduction to distributed version control with git

Software Project (Lecture 4): Git & Github

Algorithm Engineering

Windows. Everywhere else

GIT Princípy tvorby softvéru, FMFI UK Jana Kostičová,

Introduction to Version Control

213/513/613 Linux/Git Bootcamp. Cyrus, Eugene, Minji, Niko

Version Control. Version Control

John DeDourek Professor Emeritus Faculty of Computer Science University of New Brunswick GIT

Git! Fundamentals. IT Pro Roundtable! June 17, 2014!! Justin Elliott! ITS / TLT! Classroom and Lab Computing!! Michael Potter!

Versioning with git. Moritz August Git/Bash/Python-Course for MPE. Moritz August Versioning with Git

Eugene, Niko, Matt, and Oliver

Tutorial: Getting Started with Git. Introduction to version control Benefits of using Git Basic commands Workflow

Using Git to Manage Source RTL

Git, the magical version control

Git for Version Control

E, F. deleteall command, 352 directory structure, 350 export_data method, 353 inline_data method, 353 print_export method, 351 target directory, 351

Version Control Tutorial

Using git to download and update BOUT++

Introduction to Version Control using Git

Version Control System - Git. zswu

Lab Objective. Lab Assignment. Downloads and Installation

CSE 391 Lecture 9. Version control with Git

Introduction to Git and Github

Revision control. INF5750/ Lecture 2 (Part I)

Source Code Management wih git

Git. Ľubomír Prda. IT4Innovations.

Git AN INTRODUCTION. Introduction to Git as a version control system: concepts, main features and practical aspects.

VCS VERSION CONTROL SYSTEMS

Lecture 2 Making Simple Commits

Why To Go With Licensed Version Control Tool When Open Source Tool Is There

Git. Charles J. Geyer School of Statistics University of Minnesota. Stat 8054 Lecture Notes

Index. Alias syntax, 31 Author and commit attributes, 334


An introduction to git

Chapter 5. Version Control: Git

Common Git Commands. Git Crash Course. Teon Banek April 7, Teon Banek (TakeLab) Common Git Commands TakeLab 1 / 18

Version Control Systems

Git Tutorial. Version: 0.2. Anders Nilsson April 1, 2014

Version Control Systems

Git. Presenter: Haotao (Eric) Lai Contact:

Software Development I

A Brief Introduction to Git. Sylverie Herbert (based on slides by Hautahi Kingi)

Git AN INTRODUCTION. Introduction to Git as a version control system: concepts, main features and practical aspects.

1/20/13 Git tutorial. Git tutorial. Mike Nolta. file:///users/nolta/github/reveal.js/git.html?print-paper#/ 1/31

Version Control. Software Carpentry Github s Hello World Git For Ages 4 And Up You need source code control now

Salvatore Rinzivillo VISUAL ANALYTICS

Revision Control. An Introduction Using Git 1/15

USING GIT FOR AUTOMATION AND COLLABORATION JUSTIN ELLIOTT - MATT HANSEN PENN STATE UNIVERSITY

Version Control with GIT: an introduction

Version Control: Gitting Started

Outline. Version Control System (VCS) basics Git terminology & concepts Basic Git commands Branches in Git Git over the network (time permitting)

G E T T I N G S TA R T E D W I T H G I T

A quick (and maybe practical) guide to Git and version control. By Jay Johnson

Introduction to Version Control with Git and GitHub

Learn GIT IN A MONTH OF LUNCHES

Git Tutorial. André Sailer. ILD Technical Meeting April 24, 2017 CERN-EP-LCD. ILD Technical Meeting, Apr 24, 2017 A. Sailer: Git Tutorial 1/36

Git version control with Eclipse (EGit) Tutorial

Lab Exercise Git: A distributed version control system

Software Revision Control for MASS. Git Installation / Configuration / Use

Distributed Version Control Git

Barry Grant

What is Git? What is Git? Version Control. Barry Grant

GETTING STARTED WITH. Michael Lessard Senior Solutions Architect June 2017

本文列出 Git 常用命令, 点击下图查看大图

CSCE UVM Hands-on Session-1 Pre-Work

an introduction to git

A BASIC UNDERSTANDING OF VERSION CONTROL

About SJTUG. SJTU *nix User Group SJTU Joyful Techie User Group

Version control. what is version control? setting up Git simple command-line usage Git basics

Version Control with Git

February 2 nd Jean Parpaillon

git Version: 2.0b Merge combines trees, and checks out the result Pull does a fetch, then a merge If you only can remember one command:

Version Control. Second level Third level Fourth level Fifth level. - Software Development Project. January 17, 2018

Department of Computer Science College of Engineering Boise State University

Revision Control and GIT

Git AN INTRODUCTION. Introduction to Git as a version control system: concepts, main features and practical aspects.

EECS 470 Lab 4. Version Control System. Friday, 31 st January, 2014

Github Webinar Documentation

Introduction to the UNIX command line

Gitlab Setup/Usage by Yifeng Zhu modified by Vince Weaver 30 January 2019

Fundamentals of Git 1

Pragmatic Guide to Git

From Commits to Collaboration: A Git Tutorial for Social Scientists

Transcription:

LAB MANUAL GIT BY PRATIK JAIN STARTING WITH GIT : To start with git bash, we need to authenticate ourselves so that for every commit, git can use this information. We can remove -- global option to override this information for some other projects. 1

GIT EDITOR By default Git uses default text editor which is Vi or Vim but you can change editor such as emacs by following command. git config --global core.editor emacs GIT CONFIG It will show all the attributes of configuration file which we have set. git config --list GIT HELP It will open a browser window as a help for config command. git help config 2

CREATING REPOSITORY It will create.git directory in your project directory. git init CLONING REPOSITORY Instead of using https://, you can use git:// protocol or user@server:/path.git, which uses the SSH transfer protocol. 3

GIT STATUS If you run this command, just after cloning repository. You will see there is nothing to commit all files are tracked and unmodified. You can use s option for checking status in short and concise way. It shows result which has below terminology.? Untracked files A Added files M Modified files R Rename 4

TRACKING NEW FILES Create a first file gitfirst.txt and check status. We need to add this new gitfirst.txt file and make it ready to commit but we can see clone repository or file textmate still untracked. git add gitfirst.txt 5

Create a file second.txt in project folder and check status again. Add file gitsecond.txt to stage for commit. 6

Modify gitsecond.txt file and check git status again. While checking again, you will find gitsecond.txt is in both staged and unstaged area. Git stage file as you run git add command, so if you commit now git will send a gitsecond.txt version which you added it earlier and is in staged area. After each modification you need to add a file. 7

GIT IGNORING There can be bunch of files, in your project directory which you want git to ignore. Git should not show them to add or as untracked. These are basically auto generated files like log files, or temporary files. To ignore those files create.gitignore named file listing patterns to match files. 8

In.gitignore file list all patterns which you want git to ignore. Create a.class file to check that git is ignoring those class files or not. 9

GIT DIFF You can check your staged and unstaged changes through git status but git diff will give details of what is changed in files. To see what you have changed but not yet staged, type git diff with no other arguments. Git diff --staged It gives the details of files which you have staged and will go into next commit. 10

It s important to note that git diff by itself doesn t show all changes made since your last commit only changes that are still unstaged. If you have staged all your changes, git diff will give you no output. 11

GIT COMMIT Check if all the files are staged, then you can commit. If any file is in unstaged area that won t go in commit. Just type git commit to commit. Git commit command gives you access to write some message before committing. 12

This will commit all your changes which are staged with SHA1 reference. Without Message in editor git commit m Commiting First Changes If you modify some file, for example gitsecond.txt and try to commit without adding it. Then it won t be possible. First you have to add then commit. You can use commit with option a which will commit and add all the unstaged files. 13

We can see from our commit, which branch you committed to (master), what SHA-1 checksum the commit has (1e86e15), how many files were changed, and statistics about lines added and removed in the commit. Everytime you are commiting, you are taking snapshots of your staging area. GIT REMOVE To remove files which are tracked or in staging area, you need git rm command and then commit. Removes all the Files that end with ~ $ git rm \*~ If you simply remove the file from your working directory using rm command, file will be in unstaged area( Changes not staged for commit ). 14

GIT MOVE Git explicitly does not track file movement, and it does not store any metadata like if you rename the file. But git has mv command. 15

This git mv command is actually equivalent to three commands stated in below example. 16

GIT LOG Gives you details with checksum and messages in chronlogical order of commits. git log Option -p will show differences introduced in each commit and -2 will restrict it to only last two entries. git log p -2 If we want to see some abbreviated stats for each commit. It also puts summary of information at the end. git log --stat Option --pretty changes the log output to formats other than the default. There are some predefined formats. git log --pretty=format:"%h - %an, %ar : %s Where %h is abbr. commit hash, %an is author name, %ar is author date(relative) and %s is subject or message. %ad can also be used for date format. 17

GIT GUI FOR HISTORY Visualize tool with git to check commit history. Its basically a git log tool and accepts all options which git log provides. gitk It comes with git gui tool also. git gui 18

REFERENCES SVN-Book GIT- Book GIT - Quick Reference 19