---+ Kate learns Git: a choose your own adventure Goal: become comfortable with the ATLAS Git workflow so that I can be useful again. I need to understand how to easily update my code to pick up new changes centrally, control the branches i am on and syncing with, do everything while maintaining a sparse checkout, and request my changes be merged. ---++ Relevant links ---+++ Documentation The ATLAS tutorial is [[https://atlassoftwaredocs.web.cern.ch/gittutorial/][here]] and the jet trigger specific tutorial is here. Somebody else's useful Git twiki is [[Main.MyGitOdyssey][here]]. Kerim's running instructions from June P&P week are [[https://indico.cern.ch/event/641263/contributions/2601019/attachments/1470069/2274364/ppPlenaryKSuruliz02062017.pdf][here]]. ---+++ Code Athena home [[https://gitlab.cern.ch/kpachal/athena][My athena fork]] A full walkthrough of What's going on? Find the branch I'm on ---++++++ Find the branches available For all local and remote branches, <verbatim>git branch -a</verbatim> For just all remote branches, <verbatim>git branch -r</verbatim> ---++++++ Make a new branch <verbatim> git branch -b myNewBranch </verbatim> ---++++++ Find out the branches i'm pointing to <pre>git branch -vv</pre> example: <pre>-bash-4.1$ git branch -vv<br />* 21.0-add-TrigHLTJet-caloWIDTH 7565218 [origin/21.0-add-TrigHLTJet-caloWIDTH: ahead 1] first try help<br /> master a7f6dc3 [origin/master] Merge branch 'cherry-pick-f12f2321' into 'master'</pre> First line: branch I am on and the latest commit Second line: ---++++++ Update everything I have locally to the most recent version in the central Athena repository To download the updates which exist in Athena centrally, assuming upstream is properly set (see above): <pre>git fetch upstream</pre> Now checkout would potentially mess with the sparse checkout I have, so do: <pre>git pull upstream 21.0</pre> We aren't tracking a particular branch so specifying the branch of upstream to use is mandatory. ---++++++ <br />Pushing a new branch If your branch is listed, as in: <pre>-bash-4.1$ git branch -a<br />* 21.2-add-PathResolver<br /> master</pre> git push will still not create this branch unless you explicitly tell it to. Use <pre>git push origin 21.2-add-PathResolver</pre> to create it in the remote repository. ---+++++ Resolving merge conflicts To see which files have conflicts: <pre>git status</pre> Once I know a problem has been resolved and the version I have locally is the one I want to keep <pre>git add <file></pre> I have local changes I want to keep, and the ... ---++++ Making a merge request Easiest thing is to do this manually using "Create merge request" button when looking at the gitlab web interface for the relevant branch! * Check that correct source and destination branches are selected * Write detailed description * Inspect changes before hitting "submit merge request" * "Labels" drop-down on the RHS allows you to choose other releases for this to be cherry-picked into
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r4
<
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
WYSIWYG
|
M
ore topic actions
Topic revision: r4 - 2017-06-28
-
KatherinePachal
Home
Plugins
Sandbox for tests
Support
Alice
Atlas
CMS
LHCb
Public Webs
Sandbox Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
P
View
Raw View
PDF version
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Cern Search
TWiki Search
Google Search
Sandbox
All webs
E
dit
A
ttach
Copyright &© 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use
Discourse
or
Send feedback