Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 
Share Thread:
Reddit Facebook Twitter
Working with GitHub repository [updated: 04/02/2015]
10-29-2015, 05:00 PM (This post was last modified: 12-14-2018 07:16 AM by micheus.)
Post: #9
[updated: 10/29/2015]
Copying commits from a branch to another

Let say we made some changes and committed them in the wrong branch and we want to move or just copy it to the current branch - we do that using cherry-pick command.

The first we need to find the commit ID which we can do by using the log command. A list of commits will be shown:
$ git log <source branch>
Quote:commit c61c5e42edbc31f49bf3dd373e564dd3742b0d79
Author: user <user@mail.com>
Date: Wed Oct 28 18:06:42 2015 -0200

Fixed .auv file parser for menu option control
...
We need to take note of the only first seven number: c61c5e4

Now, in the current branch, we run the follow command:
$ git cherry-pick c61c5e4
Quote:[mv/shaders f2af162] Fixed .auv file parser for menu option control
1 file changed, 10 insertions(+), 1 deletion(-)
Done!

Copying only a file from a commit to another branch
$ git checkout <commit> <folder or file path in the current branch>

Retoring a file from a branch
$ git checkout <branch> <file path in the current branch>

@MicheusVieira MicheusVieira Micheuss micheus4wings3d
* Wings3D Team stands for: Björn and Dan
Reply


Messages In This Thread
Updated: 06/15/2015 - micheus - 06-15-2015, 09:02 PM
[updated: 10/29/2015] - micheus - 10-29-2015 05:00 PM
Using Dialyzer - micheus - 04-17-2019, 01:37 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)