---
# System prepended metadata

title: CodeRefinery Karlstad workshop 22-23 September
tags: [Karlstad, workshop, CodeRefinery]

---

# CodeRefinery Karlstad workshop 22-23 September

Please ask questions always at the bottom of this page.

**URL of this document:**
https://hackmd.io/@coderefinery/coderefinery-karlstad

**Workshop webpage:**
https://wikfeldt.github.io/2020-09-22-karlstad/

## Welcome

Please make sure that Git is installed and configured:
`git --version`
should give you a version number.

Configuration steps: https://coderefinery.github.io/git-refresher/01-setup/#configuring-git



### Instructors and helpers

- Diana Iusan
- Pavlin Mitev
- Raphaela Heil
- Thor Wikfeldt


### Icebreaker: Please write your name, where you work, Git experience and optionally what you're working on

- Thor Wikfeldt: just started a new job within the new EuroCC National Competence Center Sweden (ENNCS) where I'll be developing training portfolio. Been teaching Git for 3 years
- Pavlin Mitev: Application expert at [UPPMAX](https://www.uppmax.uu.se/), computational chemistry, molecular and lattice dynamics and related properties. Keywords: VASP, CRYSTAL, GULP, awk, ASE, Gaussian 
- Raphaela Heil: PhD student at Uppsala University working with historic handwritten text recognition. First time teaching Git
- Håke Karlsson: Working at Ingesund School of Music at Karlstad University. No experience in Git. Might be in over my head but want an introduction! Have been working with internal system database scripting (FileMaker). 
- Diana Iusan - application expert and training coordinator at [UPPMAX](https://www.uppmax.uu.se/). Main expertise: computational physics. Typical tasks: installing software, performance analysis of codes, ...
- Robert Ohuru - ICT developer University of Twente, Netherlands. Working on multiple projects that require software versioning. Involved in open science initiatives where we encourage students to distribute their codes in shared repositories.I have experience using Git.
- Andrew Harbicht - Post-doc in Biology (Karlstad University), I have used GIT with R-studio and I collaborate with other researchers often enough that improving my Git knowledge would be helpfull.
- Dan Wu - Post-doc in paper mechanics (Lund University), I am new with GIT. 
- Stefan Alfredsson - Senior lecturer at Karlstad University, Computer Science. Been using git for 10+ years (used it for my PhD thesis, among other things). Unfortunately double-booked for the workshop with other work, but will listen/participate opportunistically.
- Surendra Nepal -   PhD student in Mathematics (Karlstad University). I am new for Git.
- 
### Please write your GitHub username here 
-- We will be adding you as collaborators on a GitHub repository

- wikfeldt
- pmitev
- robertohuru
- dianaiusan
- hakemhi
- aharbicht
- alfs
- DanWuuu
- surenepa
- 

## Questions below here 
(don't worry about the correct format, just type your question and we can polish the format later)

- @raphaela what technique are you using to capture your command history?
    - Raphaela: https://github.com/coderefinery/manuals/blob/master/presenting.md#screencasting (I am using  zsh)
    - from Pavlin (might be fdifferent from what Raphaela is using): https://github.com/rgaiacs/swc-shell-split-window

- Is it possible to add a file and commit it at the same time?
    - yes, with the -a option to `git commit` ! E.g. `git commit -a -m <msg>`
    - note: new files will be ignored with `-a`

- Should `.gitignore` be part of the repository or not?
    - yes, so that everyone has the same experince / practice
    - also when you yourself are using different computers, you want `git status` to show the same output regardless

- How can one remove a file alltogether from the stage?
    - try it! do a change, stage it, and type `git status` - it tells you what to do. 
    - `git reset -p` or `git reset $file` (staging area)  
      ref. https://coderefinery.github.io/git-intro/05-undoing/ 
      ![](https://i.stack.imgur.com/qRAte.jpg)

- What about adding a directory to the stage? How are the files within treated?
    - actually, it's impossible to stage only the directory, git works only with files. What you would do is to stage a file within a directory. If you for some reason really need to add an empty directory to a repository, the convention is to add an empty `.gitkeep` file in that directory
    - but if you have a directory with many files you can do `git add dirname` and all the files within get staged

- when forgetting to include a comment with a git commit, the editor opens. I'm not sure what to do with this, write out does not seem like the best option, but I don't see anything else that makes sense.
    - ah yes, is it an editor you're not familiar with? if you're on linux or macos it could be that the vim editor opens by default. vim is tricky but you can set another editor to be the default (https://coderefinery.github.io/installation/git/#configuring-git). To exit vim, type `:q`
        - but opening an editor like this is useful if you want to write longer commit messages: start with short summary on line 1, then longer explanation on line 3 and below
    - 

- The fact that the .DS_Store shows up as untracked file on a Mac I guess is because I have opened the directory from the GUI?
    - yeah I think Finder on macos creates these .DS_Store files. I think it makes sense to ignore this file in your .gitignore

- In the event that someone has not had their coffee yet and accidentally starts their day with "git init",is past work lost and is pulling from the server the only way to recover the previous work?
    - this is safe and will not overwrite things that are already there


## Collaborative Git

Centralized workflow repo:
https://github.com/coderefinery/centralized-workflow-exercise


- any ideas as to why github uses "pull request" when it involves pushing rather than pulling?
    - I believe the terminology is based on the point of view of the master branch -> you are requesting the master branch to pull your changes

- How can a team lead create issues for other collaboraters?
    - You may assign an issue to someone this way: [Assigning issues and pull requests to other GitHub users](https://docs.github.com/en/github/managing-your-work-on-github/assigning-issues-and-pull-requests-to-other-github-users)


- question
    - answer


### Forking workflow repo:
https://github.com/coderefinery/forking-workflow-exercise/




### Lesson on automated testing: 
https://coderefinery.github.io/testing/ 


## Feedback

Please write one thing you liked and one thing you thing can be improved
- Very impressive presentation and much to learn. 

- Very nice presentation with details
- Very good overview for me as completely new to git. Head full now so things have to sink in! 
- Very nice presentations and introductions and friendly to new Git-users. 
- one good thing
- one thing to improve

- Can’t really come up with things to improve…. Level was perfect for me and I now have the overview that I need!

- I felt it was a lot to cover moreso the second day had advanced concepts. I would appreciate more time. But anyways, thanks for the materials. We can look at them later.

- I thought that the range of topics covered in the course was appropriate. Not too much and not too little. However I would have appreciated a more regimented following of the steps. Sometimes we went on tangents and when everything is new and spread across multiple windows it is easy to get confused/lost
...

---
###### tags: `workshop` `CodeRefinery` `Karlstad` 