RSS

GIT: Using the stash

Best use case to use / apply stash: I have made some change in the pom.xml which are local to my dev box, whenever I take the pull, they gets washed away (over written) by the remote version. Now I have to put entire thing again after taking pull which consumes lot of time.

Solution – apply stash : Instead of doing the commit I create the local changes stash and apply them whenever I need those changes. I can discart them before taking the pull and apply them to get my local changes again.

stash

I will upload a you tube video soon Smile to explain this better.

 

Detailed explanation :

Often, when you’ve been working on part of your project, things are in a messy state and you want to switch branches for a bit to work on something else. The problem is, you don’t want to do a commit of half-done work just so you can get back to this point later. The answer to this issue is the git stashcommand.

Stashing takes the dirty state of your working directory — that is, your modified tracked files and staged changes — and saves it on a stack of unfinished changes that you can reapply at any time.

 
 
Stashing Your Work

To demonstrate, you’ll go into your project and start working on a couple of files and possibly stage one of the changes. If you run git status, you can see your dirty state:

$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#      modified:   index.html
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#
#      modified:   lib/simplegit.rb
#

Now you want to switch branches, but you don’t want to commit what you’ve been working on yet; so you’ll
stash the changes. To push a new stash onto your stack, run git stash:

$ git stash
Saved working directory and index state \
  "WIP on master: 049d078 added the index file"
HEAD is now at 049d078 added the index file
(To restore them type "git stash apply")

Your working directory is clean:

$ git status
# On branch master
nothing to commit, working directory clean

At this point, you can easily switch branches and do work elsewhere; your changes are stored on your stack. To see which stashes you’ve stored, you can use git stash list:

$ git stash list
stash@{0}: WIP on master: 049d078 added the index file
stash@{1}: WIP on master: c264051 Revert "added file_size"
stash@{2}: WIP on master: 21d80a5 added number to log

In this case, two stashes were done previously, so you have access to three different stashed works.
You can reapply the one you just stashed by using the command shown in the help output of the original stash command: git stash apply. If you want to apply one of the older stashes, you can specify it by naming it, like this: git stash apply stash@{2}. If you don’t specify a stash, Git assumes the most recent stash and tries to apply it:

$ git stash apply
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#
#      modified:   index.html
#      modified:   lib/simplegit.rb
#

You can see that Git re-modifies the files you uncommitted when you saved the stash.
In this case, you had a clean working directory when you tried to apply the stash, and you tried to apply it on the same branch you saved it from; but having a clean working directory and applying it on the same branch aren’t necessary to successfully apply a stash. You can save a stash on one branch, switch to another branch later, and try to reapply the changes. You can also have modified and uncommitted files in your working directory when you apply a stash — Git gives you merge conflicts if anything no longer applies cleanly.

The changes to your files were reapplied, but the file you staged before wasn’t restaged. To do that, you must run the git stash apply command with a --index option to tell the command to try to reapply the staged changes. If you had run that instead, you’d have gotten back to your original position:

$ git stash apply --index
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#      modified:   index.html
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#
#      modified:   lib/simplegit.rb
#

The apply option only tries to apply the stashed work — you continue to have it on your stack.
To remove it, you can run git stash drop with the name of the stash to remove:

$ git stash list
stash@{0}: WIP on master: 049d078 added the index file
stash@{1}: WIP on master: c264051 Revert "added file_size"
stash@{2}: WIP on master: 21d80a5 added number to log
$ git stash drop stash@{0}
Dropped stash@{0} (364e91f3f268f0900bc3ee613f9f733e82aaed43)
 
Leave a comment

Posted by on May 19, 2015 in git

 

Tags: , ,

Understanding standard Auto insurance in USA

 
 

Tags:

link : Online practice test link to pass Drivers license written exam and get DL in USA

To obtain drivers license, first step is to clear written exam. It is not that simple, you have to score around 85 to 90% to pass exam, ie you are allowed to make only 3 to max 5 mistake in entire question paper. Basically candidate is asked around 30 objective questions. I am sharing this link which is free and best to learn and practice. (I studies with this link and cleared written paper in first attempt)

http://driving-tests.org/california/

Please remember, that different states has different questions and pattern. You can pick the state and start pracitce exams http://driving-tests.org/

Steps :

1. Get the Drivers handbook or manual from DMV office or download it from https://apps.dmv.ca.gov/pubs/dl600.pdf

2. When you are done reading entire handbook start free practice test from website http://driving-tests.org/california/

3. When you start scoring more then 90%, take online appointment and visit DMV office with all your documents like passport, ssn number, visa papers, your current driving license (out of US as well) https://www.dmv.ca.gov/portal/dmv/detail/portal/foa/welcome?localeName=en

4. Once you pass written test they will give you permit (can can only drive with an adult driving license holder), however if you already have a valid out of US DL, in that case you might directly get the temp . driver license (driver independently / alone).

5. Join driving school or rent a car and practice and then appear for field test (behind the wheel driving test) when you are ready by taking online appointment  https://www.dmv.ca.gov/portal/dmv/detail/portal/foa/welcome?localeName=en

 

Best of Luck friendsWinking smile

 
Leave a comment

Posted by on May 4, 2015 in Online Tools

 

Tags: , , , ,

Help others to help your self :-)

 
Leave a comment

Posted by on April 29, 2015 in Art of living, Video Blog

 

Tags: ,

Nepal drone reveals extent of earthquake devastation

Published on 27 Apr 2015

Video footage filmed using a drone gives a bird’s eye view of the devestation caused by Nepal’s recent earthquake in Kathmandu. Monday 27 April.

 
Leave a comment

Posted by on April 29, 2015 in Life

 

Art of Living yoga : Padma Sadhna

‘Padma’ means lotus and ‘Sadhana’ is your effort. This practice should therefore be as effortless and light as a lotus. Sadhana is the gentle nudge to get on to the mat and Padma is the unfurling of your potential, layer by layer. Together, Padma Sadhana can help you blossom from within through the practice of yoga postures.

5 elements for a blissful Padma Sadhana

According to the Agama tradition*, it is believed that the Devi (Goddess) sits on a five-layered seat or asana. The base of this seat is a tortoise, which represents stability. Stability alone is not enough. You need awareness also. So the second layer is the snake, which represents awareness. Awareness can lead to activity in the mind. So above the snake sits the lion, which symbolizes grace. Above the lion sits the Siddha, the perfect sage. And above the perfect sage sits the lotus, the symbol of full blossoming. When our yoga postures have all these five qualities – stability, awareness, grace, perfection and full blossoming, then the divinity dawns in us and that is Padma Sadhana.

Sri Sri says doing PadmaSadhana gives you access to your inner strength. When practiced daily, this 45-minute sequence of yoga poses can lead to a calmer mind, healthier body and more peace. This set of graceful yoga asanas (postures) helps prepare the body and mind for deeper meditation. One of the key tips is to stay relaxed throughout the practice. Doing Padma Sadhana before Sudarshan Kriya enhances your experience, so that you remain uplifted throughout the day, untouched by the mud around you.

5 Tips to Deepen Your Padma Sadhana

A very gentle yet deep yoga technique, Padma Sadhana, is experiencing meditation through asanas (yoga postures). The entire Padma Sadhana sequence is 40-minute long, which includes 10 minutes of yoga postures, 5 minutes of pranayama (breathing technique), 20 minutes of meditation, again followed by 5 minutes of pranayama. The yoga postures in Padma Sadhana flow into each other, with each yoga pose complementing the preceding one. When done correctly, Padma Sadhana stretches the body and prepares the mind for meditation. In fact, each yoga posture in the Padma Sadhana sequence becomes a meditative experience by itself.

Just as it is important to know how to do Padma Sadhana (move the body into yoga postures). It is also important to practice Padma Sadhana with the right attitude, the right feeling.

Follow the five tips and make your Padma Sadhana experience blissful, deep and meditative.

#1 Keep the body stable. When you get into any posture for Padma Sadhana, ensure that you are not very unsteady or uncomfortable. Meditation happens when the body is at ease. The Patanjali Yoga Sutra, Sthira Sukham Asanam, gives prime importance to both stability and comfort while doing your asanas (sthira=stable; sukham=comfort).

If your body is shaky in a particular posture, it means you are overdoing. Find a position that is stable and comfortable for you.

#2 Be aware of what is happening. Once you have attained stability in the yoga posture, move on to the next level – awareness.

Simply being stable in a yoga pose can either bring dullness or make the mind wander. For instance, in Shavasana (Corpse Pose), you can be stable in the position but what if you go off to sleep? Or you start forming a chain of thoughts in your mind?

Yoga is doing the yoga postures with the awareness that ‘I am doing the stretch, my breath is moving in and out, my heart is beating, my thoughts are coming and going.’ This doesn’t mean that one keeps thinking – I am doing this stretch and my heart is beating. It simply means drawing your attention to this and then letting go of the thought. When the mind experiences this state of awareness, being totally in the present moment, it slips into meditation.

#3 Let the yoga poses flow gracefully like a dance. The whole beauty of Padma Sadhana lies in the graceful manner in which it is carried out. You may be totally aware of the movement but you may just be doing it mechanically like a robot. Moreover, there are chances of injuring yourself while doing a stretch with a jerk or with stiffness. With awareness, you can bring grace in your postures. Do them very gently, coordinating each body movement with therhythm of breath consciously. Moreover, doing yoga poses gracefully with a smile relaxes the mind.

#4 Strive to develop perfection. Simply being graceful in your movements, even though you don’t get them right, again doesn’t help. You need to perfect your yoga posture too. Again, with awareness you are able to identify if you are doing a posture gracefully but not being able to stretch more than a point to get the asana right. This becomes possible with regular practice and a bit of effort.

Take for example the Bow Pose (Dhanurasana). If you find it difficult to hold that pose for long, keep practicing daily and you will notice the posture becoming effortless and more graceful over the days.

#5 Go beyond the body. Padma means lotus. Just as a lotus blossoms, one’s potential can also expand with the practice of Padma Sadhana.

How does this happen? Certainly all the four tips above contribute – yet the real secret is this: go beyond the body.

All of us want to achieve that perfect posture and would be satisfied if we could do a series absolutely perfectly. But you’re a yogi! As a yogi, you know it is not wise to get stuck at the perfection level of the asana – go beyond and observe what is happening inside of you. Are you experiencing the true essence of yoga: the union of the body, mind and spirit?

Yoga practice is not a substitute for medicine. Please consult a doctor before practicing yoga postures. It is important to learn and practice yoga postures under the supervision of a trained Art of Living Yoga teacher. Find an Art of Living Yoga course at an Art of Living Center near you. Do you need information or share feedback? Write to us at info@srisriyoga.in.

 
Leave a comment

Posted by on April 26, 2015 in Art of living, Health and Fitness

 

Tags: ,

Yoga by Art of Living – youtube play list

You can see and do yoga. It is a very efficient way. The publisher of the tutorial is a very big organization called as Art of living.

 
Leave a comment

Posted by on April 26, 2015 in Art of living

 

Tags:

 
Follow

Get every new post delivered to your Inbox.

Join 1,179 other followers

%d bloggers like this: