Jump to content

Infrastructure/Git/Recipes: Difference between revisions

From KDE Community Wiki
Halla (talk | contribs)
m typo
Skierpage (talk | contribs)
mark with Template:Proposed deletion , mention same page is on techbase (I don't know which location is better)
Tag: Replaced
 
(22 intermediate revisions by 6 users not shown)
Line 1: Line 1:
== Git Recipes ==
{{Proposed deletion|reason=identical page name on [[techbase::Development/Git/Recipes|techbase]] got more edits 2018-2020 than this}}
 
 
Brief recipes for common use cases.
:''See nearly identical page on [[techbase::Development/Git/Recipes|techbase]]''
 
=== Working with remote branches ===
 
Remote branches are branches created on the main KDE repository.  These may be a stable branch that you need to do bugfixes on, i.e. the 4.6 release, or a feature branch based on master.
 
git branch --track <local-branch> <remote-branch>
git checkout <local-branch>
git push origin <local-branch>:<remote-branch>
 
=== Working with stable branches ===
 
For kdelibs, kdepimlibs, kde-runtime, kate, konsole and kde-workspace, the remote stable branches are named as follows:
 
origin/KDE/4.6
 
For these modules, to set up a local stable branch to track the remote stable branch:
 
git branch --track KDE/4.6 origin/KDE/4.6
git checkout KDE/4.6
 
To then push changes to the remote stable branch:
 
git push origin KDE/4.6:KDE/4.6
 
In other projects the remote stable branches are named as follows:
 
origin/4.6
 
For these modules, to set up a local stable branch to track the remote stable branch:
 
git branch --track 4.6 origin/4.6
git checkout 4.6
 
To then push changes to the remote stable branch:
 
git push origin 4.6:4.6
 
=== Cherry Picking ===
 
Cherry picking is a way to copy a single commit from one branch to another.
 
When cherry picking between stable and unstable branches, use the following form:
 
git cherry-pick -e -x <original-commit>
 
==== Common Options ====
 
'''-e''' will allow you to edit the commit message to add any extra details and to change the BUG/CCBUG/FIXED-IN messages.
 
'''-x''' will automatically add the original commit number to the end of the commit message to enable better tracing and to simplify merging.  Only do this if the original commit was already published in a public repository, e.g. your are forward porting or back porting the patch.
 
'''-n''' will cherry-pick the changes but not commit them to the new branch.  This is very use full if you need to do further work on a commit.

Latest revision as of 09:19, 25 May 2025

Proposed for Deletion

This page has been proposed for deletion for the following reason:

identical page name on techbase got more edits 2018-2020 than this

Please use the discussion section of this page to voice your opinion on this.
See nearly identical page on techbase