Loading...
 

Git cherry-pick

You want to replicate a specific merge request or commit from one branch to another. Typically to

  1. Backport from master (trunk) to a stable branch (ex.: 26.x) or
  2. A fix that was first made in a stable branch (ex.: 26.x), and that should also be in master (trunk)


The best tool to achieve this procedure is the git cherry-pick. Please keep in mind that one merge request (MR) may contain one or many commits (sometimes, they are squashed into one, but not always).

Example

Folder structure

The next example assumes an existing folder named tiki26 with versioned by Git and another folder tikimaster, also versioned by Git. The tiki26 is tracking branch 26.x while tikimaster folder is tracking branch master (trunk).

Copy to clipboard
| . | .. | tikimaster | tiki26


1.1.1. Getting commit(s) and message

Type git log, search for commit(s) to be backported, copy its hash and assign it to a variable name TARGET_COMMIT.

Copy to clipboard
TARGET_COMMIT=1f0d6c95b936aeface9a4d7bf4d2a5b18782d1e7 TARGET_MESSAGE=$(git log $TARGET_COMMIT -n1 --format='%B')

1.1.2. Update repository

Copy to clipboard
cd tiki26 git pull

1.1.3. Cherry-pick commit(s)

Copy to clipboard
git cherry-pick $TARGET_COMMIT

1.1.4. Test

Test that the cherry-picked commit(s) has(ve) intended effects without unwanted side-effects

1.1.5. Push it to 26.x

Copy to clipboard
git push

Procedure with the GitLab GUI

The recommended procedure is to use the CLI as documented above


Why is the CLI better?

  • Easily test before making the PR
  • A PR can have more than one commit (and the GitLab GUI doesn't offer this)


If despite this, you choose to proceed with the GitLab GUI:

  1. In the GitLab.com web interface, find the specific commit
  2. On that commit, pick "Options" -> "cherry-pick" and pick the branch
    • You have a choice of committing directly or transforming into a merge request


To see which merged MRs are still missing a cherry pick, use this GitLab query: https://gitlab.com/tikiwiki/tiki/-/merge_requests?scope=all&state=merged&label_name[]=needsCherryPicksTo%3A%3A*



Keywords

The following is a list of keywords that should serve as hubs for navigation within the Tiki development and should correspond to documentation keywords.

Each feature in Tiki has a wiki page which regroups all the bugs, requests for enhancements, etc. It is somewhat a form of wiki-based project management. You can also express your interest in a feature by adding it to your profile. You can also try out the Dynamic filter.

Accessibility (WAI & 508)
Accounting
Administration
Ajax
Articles & Submissions
Backlinks
Banner
Batch
BigBlueButton audio/video/chat/screensharing
Blog
Bookmark
Browser Compatibility
Calendar
Category
Chat
Comment
Communication Center
Consistency
Contacts Address book
Contact us
Content template
Contribution
Cookie
Copyright
Credits
Custom Home (and Group Home Page)
Database MySQL - MyISAM
Database MySQL - InnoDB
Date and Time
Debugger Console
Diagram
Directory (of hyperlinks)
Documentation link from Tiki to doc.tiki.org (Help System)
Docs
DogFood
Draw -superseded by Diagram
Dynamic Content
Preferences
Dynamic Variable
External Authentication
FAQ
Featured links
Feeds (RSS)
File Gallery
Forum
Friendship Network (Community)
Gantt
Group
Groupmail
Help
History
Hotword
HTML Page
i18n (Multilingual, l10n, Babelfish)
Image Gallery
Import-Export
Install
Integrator
Interoperability
Inter-User Messages
InterTiki
jQuery
Kaltura video management
Kanban
Karma
Live Support
Logs (system & action)
Lost edit protection
Mail-in
Map
Menu
Meta Tag
Missing features
Visual Mapping
Mobile
Mods
Modules
MultiTiki
MyTiki
Newsletter
Notepad
OS independence (Non-Linux, Windows/IIS, Mac, BSD)
Organic Groups (Self-managed Teams)
Packages
Payment
PDF
Performance Speed / Load / Compression / Cache
Permission
Poll
Profiles
Quiz
Rating
Realname
Report
Revision Approval
Scheduler
Score
Search engine optimization (SEO)
Search
Security
Semantic links
Share
Shopping Cart
Shoutbox
Site Identity
Slideshow
Smarty Template
Social Networking
Spam protection (Anti-bot CATPCHA)
Spellcheck
Spreadsheet
Staging and Approval
Stats
Survey
Syntax Highlighter (Codemirror)
Tablesorter
Tags
Task
Tell a Friend
Terms and Conditions
Theme
TikiTests
Federated Timesheets
Token Access
Toolbar (Quicktags)
Tours
Trackers
TRIM
User Administration
User Files
User Menu
Watch
Webmail and Groupmail
WebServices
Wiki History, page rename, etc
Wiki plugins extends basic syntax
Wiki syntax text area, parser, etc
Wiki structure (book and table of content)
Workspace and perspectives
WYSIWTSN
WYSIWYCA
WYSIWYG
XMLRPC
XMPP




Useful Tools