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 here and the jet trigger specific tutorial is here.

Somebody else's useful Git twiki is here.

Kerim's running instructions from June P&P week are here.

Code

Athena home

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,

git branch -a

For just all remote branches,

git branch -r

Find out the branches i'm pointing to
git branch -vv

example:

-bash-4.1$ git branch -vv
* 21.0-add-TrigHLTJet-caloWIDTH 7565218 [origin/21.0-add-TrigHLTJet-caloWIDTH: ahead 1] first try help
master a7f6dc3 [origin/master] Merge branch 'cherry-pick-f12f2321' into 'master'

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):

git fetch upstream

Now checkout would potentially mess with the sparse checkout I have, so do:

git pull upstream 21.0

We aren't tracking a particular branch so specifying the branch of upstream to use is mandatory.

Resolving merge conflicts

To see which files have conflicts:

git status

Once I know a problem has been resolved and the version I have locally is the one I want to keep

git add <file>

I have local changes I want to keep, and the automatic m

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r2 - 2017-06-06 - KatherinePachal
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

  • Edit
  • Attach
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 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