milosev.com
  • Home
    • List all categories
    • Sitemap
  • Downloads
    • WebSphere
    • Hitachi902
    • Hospital
    • Kryptonite
    • OCR
    • APK
  • About me
    • Gallery
      • Italy2022
      • Côte d'Azur 2024
    • Curriculum vitae
      • Resume
      • Lebenslauf
    • Social networks
      • Facebook
      • Twitter
      • LinkedIn
      • Xing
      • GitHub
      • Google Maps
      • Sports tracker
    • Adventures planning
  1. You are here:  
  2. Home
  3. Windows
  4. GIT

Git Cherry-Pick: Apply a Specific Commit to Another Branch

Details
Written by: Stanko Milosev
Category: GIT
Published: 01 March 2026
Last Updated: 01 March 2026
Hits: 31

If I want to apply a specific commit to another branch, I can use git-cherry-pick

First I will check which ID I want to commint to another branch:

git log

After reviewing the commit history, press q to exit the log view and return to the command line.

In my case, the commit ID that I want to cherry-pick is 885cbf7e8090e3b040924570fdb574bb63ee5914.

Now switch to the target branch, for example liveDataFromSeparateService:

git checkout liveDataFromSeparateService

Now execute the cherry-pick command:

git cherry-pick 885cbf7e8090e3b040924570fdb574bb63ee5914

Finally, push the changes to the remote repository:

git push

If you are using GitHub, you may now see pull requests (PRs) related to this change. In most cases, you can safely ignore them.

Git Stash

Details
Written by: Stanko Milosev
Category: GIT
Published: 01 March 2026
Last Updated: 01 March 2026
Hits: 30

When I want to temporarily move my changes to a safe place—until I finish a Git operation—I use git stash.

Example:

git stash push -m "WIP layout change"

To revert last stash execute:

git stash pop

Git for ftp

Details
Written by: Stanko Milosev
Category: GIT
Published: 15 February 2014
Last Updated: 24 April 2014
Hits: 6734

To write this article, I was using this web page. As as it is written there, first download msysgit, I downloaded msysGit-fullinstall-1.8.5.2-preview20131230.exe, after unzipping it start msys.bat if it doesn start automatically, and write following lines, one by one:

cd ~
git clone https://github.com/git-ftp/git-ftp git-ftp.git
cd git-ftp.git && chmod +x git-ftp
cp ~/git-ftp.git/git-ftp /bin/git-ftp

Now you can close window, and execute git-cmd.bat.

We have to set up our ftp. First go to folder which you want to synchronize, for example C:\gitTest\First, then set up ftp user and pass. For me it was something like this:

git config git-ftp.user ftpUser
git config git-ftp.url www.milosev.com/gittest
git config git-ftp.password ftpPass

Initialize:

git ftp init

Now we can push:

git ftp push

And enjoy :)

---

if you are receiving error like:

error: could not lock config file .git/config: No such file or directory

Then do something like

mkdir .git
git config --global user.email "This email address is being protected from spambots. You need JavaScript enabled to view it."

and error message is gone. Taken from here

---

Also, it seems that before git ftp init we have to execute git init command

---

and if you are receiving error like:

fatal: bad default revision 'HEAD'

Then it seems that first you have to commit to your local git repository, something like I already described here.

---

To download to my local machine, first I had to copy my source with simple ftp client, then to repeat all previous steps to have git local repository... I couldn't find another way...

Also, when I already have repositories, after getting the source with ftp client then when I execute:

git ftp catchup

I will keep my history...

---

It seems that something like

git pull ftp://userName:This email address is being protected from spambots. You need JavaScript enabled to view it./myModule

should also work, except in my case...

---

Finally, this is my procedure how I am doing git for ftp:

git add . --all
git commit -m "Commit locally"
git ftp push

I don't understand why I have to execute "git add . --all" but without that my code will not be added to the git.

Playing with Git

Details
Written by: Stanko Milosev
Category: GIT
Published: 15 February 2014
Last Updated: 12 March 2022
Hits: 10716

First download git for Windows. There are lot of git installations, I downloaded this one. After I created two folders, like First and Second, then I opened First folder in command prompt, like I described it here. Then in command prompt I executed command:

git init

After execution of that command I received message like:

Initialized empty Git repository in C:/gitTest/First/.git/

In notepad I wrote one text file, which had only one line "first", and I name it first.txt. Now I wrote:

git add .

Dot on the end means to everything what is in that folder, and after I wrote:

git commit -m "test"

Now we can go to second folder, and open command prompt from there, and write:

git clone c:\gitTest\First

Now you will see in your folder "Second" there will be folder First, with first.txt file. Now lets open file:

C:\gitTest\Second\First\first.txt

and write, for example, second, save and close the file in command prompt go to folder for example:

C:\gitTest\Second\First

and write:

git add "first.txt"

after that:

git commit -m "test2"

Now lets go to first folder, and pull changes, that means in folder C:\gitTest\First in command prompt write:

git pull C:\gitTest\Second\First

Open file C:\gitTest\First\first.txt and see the magic.