[GRASS-dev] git: how to switch between branches?

Michael Barton Michael.Barton at asu.edu
Sun May 19 17:26:22 PDT 2019


____________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Head, Graduate Faculty in Complex Adaptive Systems Science
Arizona State University

Currently Senior Research Fellow, Institute for Advanced Sustainability Studies
Potsdam, Deutchland

voice:  480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax: 480-965-7671 (SHESC),  480-727-0709 (CSDC)
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu






I have similar questions.

Related to this, when we set up our MedLanD project Git repository, we also had some colleagues suggest using Git's forking to deal with collaborative development. But in the end, we decided to follow more of the  previous GRASS SVN approach. It relies more on good practice among developers, but it is easier to remember how to carry out the good practices.

Michael

On May 20, 2019, at 3:00 AM, grass-dev-request at lists.osgeo.org<mailto:grass-dev-request at lists.osgeo.org> wrote:

Date: Sun, 19 May 2019 19:27:34 +0200
From: Markus Neteler <neteler at osgeo.org<mailto:neteler at osgeo.org>>
To: GRASS developers list <grass-dev at lists.osgeo.org<mailto:grass-dev at lists.osgeo.org>>
Subject: [GRASS-dev] git: how to switch between branches?
Message-ID:
<CALFmHhvwDZHOqU07Q8s12qN10qMmgQdAvVYdpjCRKTYxZhcPig at mail.gmail.com<mailto:CALFmHhvwDZHOqU07Q8s12qN10qMmgQdAvVYdpjCRKTYxZhcPig at mail.gmail.com>>
Content-Type: text/plain; charset="UTF-8"

Hi,

being a kind of git newbie, I'm struggly with switching between the
different release branches (and master).

Starting from a clean state (nothing downloaded yet), it this correct:

## 0. getting the code: fork in GH, then
# git clone git at github.com<mailto:git at github.com>:your_GH_account/grass.git
# git remote ...

Now I want the each release branch in a separate directory (!) as I
keep the compiled binaries and run GRASS directly from there.

# make a local copy of the freshly cloned source code (example: relbranch76(:
cp -rp grass grass76_branch
cd grass76_branch/

## 1. preparation: check if the local branch-copy of the remote branch exists
git branch -a

# if yes:
#   nothing to do, continue below
# if not:
#   create a new local branch that tracks a remote branch
git checkout --track upstream/releasebranch_7_6
## ?? or
##  git checkout --track remotes/upstream/releasebranch_7_6

# check
git branch -a

## 2. subsequently, switching between master and branch

# switch to branch, e.g.
git checkout upstream/releasebranch_7_6

# back to master
git checkout master

Please suggest, at non-git-expert level :-)

Markus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20190520/7f6471ba/attachment-0001.html>


More information about the grass-dev mailing list