Skip to content

Commit 02b11cc

Browse files
committed
how to create and push a new branch and switch to a branch
1 parent 3b48b93 commit 02b11cc

10 files changed

Lines changed: 43 additions & 24 deletions

docs/manual-git-rstudio.html

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -733,34 +733,44 @@ <h3 id="create-a-branch-to-experiment">Create a branch to experiment</h3>
733733
</section>
734734
<section class="slide level2">
735735

736-
<h3 id="create-a-branch-to-experiment-command-line">Create a branch to experiment (command line)</h3>
736+
<h3 id="create-a-branch-to-experiment-1">Create a branch to experiment</h3>
737737
<ol type="1">
738-
<li><p>Create a branch by a checkout to new branch, <code>git checkout -b</code>:</p>
738+
<li>Open the git shell</li>
739+
<li><p>Create a branch by a checkout to new branch</p>
739740
<pre><code>git checkout -b analysis-script</code></pre></li>
740741
<li><p>Get an overview of your branches: <code>git branch</code></p></li>
741742
</ol>
742-
<p>TODO-Thierry: add screenshot of shell-version</p>
743+
<p><img src="manual-git/create-branch-rstudio.png" alt="Create branch" /></p>
743744
</section>
744745
<section class="slide level2">
745746

746747
<h3 id="effect-of-changing-switching-branches">Effect of changing switching branches</h3>
747748
<p>Add a file to the repository in a <code>src</code>-directory (see earlier)</p>
748749
<ol type="1">
749-
<li>Go back to the status of the <code>master</code> branch: TODO-thierry: add screenshot</li>
750+
<li>Go back to the status of the <code>master</code> branch</li>
751+
<li>Click on <code>analysis-script</code> in the <code>git</code> pane and select <code>(LOCAL BRANCHES) -&gt; master</code> <img src="manual-git/branch-rstudio1.png" alt="Switch branch" /></li>
752+
</ol>
753+
<p><img src="manual-git/branch-rstudio2.png" alt="Switch branch" /></p>
754+
</section>
755+
<section class="slide level2">
756+
757+
<h3 id="effect-of-changing-switching-branches-1">Effect of changing switching branches</h3>
758+
<ol type="1">
750759
<li>Verify your local directory structure: where are your files?</li>
751-
<li>Go back to the status of the new branch (e.g. <code>analysis-script</code>): TODO-thierry: add screenshot</li>
760+
<li>Go back to the status of the new branch (e.g. <code>analysis-script</code>)</li>
761+
<li>Verify your local directory structure again: where are your files?</li>
752762
</ol>
753763
</section>
754764
<section class="slide level2">
755765

756766
<h3 id="first-push-of-a-new-branch">First push of a new branch</h3>
757-
<p>TODO-Thierry: check if this is correct</p>
758767
<ol type="1">
759-
<li>Go to <code>Tools &gt; Shell</code> to open the Git Shell</li>
760-
<li>Type <code>git push -u origin</code></li>
768+
<li>Notice that the <code>pull</code> and <code>push</code> buttons in the <code>git</code> pane are grayed out</li>
769+
<li>Open the Git Shell</li>
770+
<li>Type <code>git push -u origin analysis-script</code></li>
761771
</ol>
762-
<p>After this first time, you can just click <code>push</code></p>
763-
<p>TODO-Thierry: screenshot</p>
772+
<p>This will also activate the <code>pull</code> and <code>push</code> buttons</p>
773+
<p><img src="manual-git/branch-first-push-rstudio.png" alt="First push branch" /></p>
764774
</section>
765775
<section class="slide level2">
766776

42.9 KB
Loading
22.2 KB
Loading
10.7 KB
Loading
31.7 KB
Loading

source/manual-git-rstudio.Rmd

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -302,40 +302,49 @@ Try to push (click `push`) your local changes
302302

303303
---
304304

305-
### Create a branch to experiment (command line)
305+
### Create a branch to experiment
306306

307-
1. Create a branch by a checkout to new branch, `git checkout -b`:
307+
1. Open the git shell
308+
1. Create a branch by a checkout to new branch
308309
```
309310
git checkout -b analysis-script
310311
```
311-
2. Get an overview of your branches: `git branch`
312+
1. Get an overview of your branches: `git branch`
312313
313-
TODO-Thierry: add screenshot of shell-version
314+
![Create branch](manual-git/create-branch-rstudio.png)
314315
315316
---
316317
317318
### Effect of changing switching branches
318319
319320
Add a file to the repository in a `src`-directory (see earlier)
320321
321-
1. Go back to the status of the `master` branch:
322-
TODO-thierry: add screenshot
323-
2. Verify your local directory structure: where are your files?
324-
3. Go back to the status of the new branch (e.g. `analysis-script`):
325-
TODO-thierry: add screenshot
322+
1. Go back to the status of the `master` branch
323+
1. Click on `analysis-script` in the `git` pane and select `(LOCAL BRANCHES) -> master`
324+
![Switch branch](manual-git/branch-rstudio1.png)
325+
326+
![Switch branch](manual-git/branch-rstudio2.png)
327+
328+
---
329+
330+
### Effect of changing switching branches
331+
332+
1. Verify your local directory structure: where are your files?
333+
1. Go back to the status of the new branch (e.g. `analysis-script`)
334+
1. Verify your local directory structure again: where are your files?
326335
327336
---
328337
329338
### First push of a new branch
330339
331-
TODO-Thierry: check if this is correct
340+
1. Notice that the `pull` and `push` buttons in the `git` pane are grayed out
341+
1. Open the Git Shell
342+
1. Type `git push -u origin analysis-script`
332343
333-
1. Go to `Tools > Shell` to open the Git Shell
334-
2. Type `git push -u origin`
344+
This will also activate the `pull` and `push` buttons
335345
336-
After this first time, you can just click `push`
346+
![First push branch](manual-git/branch-first-push-rstudio.png)
337347
338-
TODO-Thierry: screenshot
339348
340349
---
341350
42.9 KB
Loading
22.2 KB
Loading
10.7 KB
Loading
31.7 KB
Loading

0 commit comments

Comments
 (0)