Thursday, 20 July 2017

Make local Git branch track a remote branch

Problem:

How do I get a local git branch to track a remote branch?

Solution:

The following examples assume a branch "thebranch" and a remote "myremote". They also assume you are using git in the command line.

For Git 1.8.0 and later:

If you've already checked out "thebranch" on your local, then:

git branch -u myremote/thebranch

If you haven't checked out "thebranch" on your local, then:

git branch -u myremote/thebranch thebranch

For Git 1.7.0 until 1.7.12.4, if you've checked out "thebranch" on your local, then:

git branch --set-upstream-to=myremote/thebranch

If you haven't checked out "thebranch" on your local, then:

git branch --set-upstream-to=myremote/thebranch thebranch

References:

Saturday, 8 July 2017

Make Google Play Music ignore a folder

Problem:

How do I make Google Play Music ignore a folder of audio files on my Android device?

I have a bunch of audio books, language lessons, and voice recordings that I do not want to play when listening to music.

Solution:

One solution is to add a new file and name it ".nomedia" into the folder you would like Google Play Music to ignore.

This file can be empty, and the period in the front front of the filename is necessary.

Notes:

This was tested to work on devices using Android 5 and Android 6.0.1. Your mileage may vary on other devices.

This trick will work with any app that uses a media scanner which ignores folders with ".nomedia". See some of the references below for other examples.

In order to create the .nomedia file, you can either use your computer or use a file manager on your Android (such as "Amaze" - turn on "show hidden files and folders" in the settings to see the results).

References: