Git key Point

 

Key Point ( 1 )

In a real development environment , Imagine you didn’t tell git to include an update to a particular file in the next commit i.e Stage or git add <file> or you even stage it i.e tell git to include an update to a particular file but didn’t commit I . e  using git commit ,  telling git to keep a safe version of your project Or you want to know the working state of each file in the directory ( Working state here means , stage un-Stage , commit , un commited ) that is using git status ( Which will tell you the working state of each file )  .

 

Key Point ( 2 ) 

Git stash : This keeps your uncommitted works ( Stage or Unstage i.e Include an update to a particular file ) for later use ( by Un committed , it means the work you did not commit i.e instruct git to keep a safe version of it ).

RLE 1A : Suppose you did or didn’t stage FileA and also did not commit it , but you want to keep working on new stuff but want git to keep it temporary in memory  . That is using git stash. Also you may Re apply your stashed by using git stash –pop i.e you are telling git not to keep your uncommitted work ( either staged or un staged ) , but NOTE : git will not stash your untracked file . and also you may stash both tracked and untracked file using git stash –u

You can managed all stashed file i. tracked or untracked by using git stash list

Then you may pop drop any stashed file with the annotation git stash pop stash@{1} , will pop stash 1 file and as well you may also view the summary of the stashed file using git stash show

You may as well stash a single file , multiple or many using git stash –p

To delete all stashed work , use git stash clean and to delete a specific stashed work use git stash drop stash@{2}.d

 

 

 

 

Key Point 3

Ignoring unwanted files    # is used for commenting

To ignore  all jar   #ignore all jar

   .jar

To use an ignored files in the repository , simply use  git add –f  Apache.jar, then you may commit the forced  staged file git commit –m ‘Stage Mac.jar from my Ignored file’

Ignoring a previously commited file is using  equilvalent to deleting it using git rm Mac.Java and then make a commit with git commit –m’Delete the Mac.Java’

 

Key point 4

Using git status will give a picture of what file has been staged , Unstaged , Untracked i.e inspect working directory.

Using git log will give you a picture of the committed snapshot i.e your safe version of your project

Git log  –oneline compressed or  gives a clear summary of your committed snapshot

git log  -p will give full details of  committed snapshot

To search for any of your team commit , simple use git log –author “Dev1 Name”

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

Up ↑

%d bloggers like this: