-
Your question/comment here
-
Do we need a separate/new account of GitHub for this training?
- no, you can use your existing one.
-
Is it possible for conflicts to occur when you're branching with other people? E.g. if people edit the same file
- Yes. It's actually very hard in practice to have conflicts when you're working alone (try to stick to one branch only if you can). But with more people, this is bound to happen to an extent. Git can automatically merge changes to the same file as long as they are on different lines, but if the content of the file is code, git might still break your code when merging automatically without conflicts... but there are strategies to mitigate that to a great extent.
-
advantages of git compared to overleaf for latex docs?
- git works also offline, for example?
- you have more control, you can use different tools that git gives you.
- overleaf is a online platform for rendering and collaborating / editing latex file, it can be integrated with git meaning that you can write your latex file locally, track canges locally with git and then "push" those changes to overleaf
- so git can work offline, you commit changes, and view history without need to connecting to the intenet, you only need connection to push or pull. :+1:
- overleaf requires you - if you want to use the web editor - to be online. If you modify the files locally on your computer you do not need a connection. Git also works locally on your machine, as long as you don't want to save the work to github, or collaborate with others through github/gitlab/whatever
- a case for git without internet: you use a coding agent (interactively or not) and before it starts editing (and maybe destroy everything), you take a snapshot with git and eventually revert back to a previous state.
-
Do all the changes we make and import fo GitHub are then visible to everyone or can we control it somehow?
- you have a choice of making your repository ("project") either "private" or "public". once you make your project public, it is accessible / visible to everyone
- So once you make a project "public" all changes done during the development will be visible for everyone?
- yes, if you "push" them to github. it is also posible to work only locally for a while without updating the codebase in the github
-
It was mentioned Git is easy to set up and it doesnot require any server? What does meany by that?
- it means that you can install the software Git on your local computer, and work there. you do not need any server to use git. The server part is needed mainly when you collaborate with others, and everybody needs to have access to a central storage where they can "download" and "upload" their code
-
How about version control of larger files/data? Concerns about safety of data/sensitive data that cannot be shared without controls. (And what if the files are large?)
- git has extensions that work to track large binary files, such as git-annex or git-lfs. The tools we typically use with git work very well for text files.
- What about sensitive data?
- We will cover this point later during the course. For now it is perhaps enough that it is possible to "exclude" / "ignore" some files so that they are not being tracked by git, and therefore will not be uplaoded to gihub when you make a push
- There are also ways to encrypt some files in your repository,
but that might be a little complicated (git-crypt)
- If your data doesn't change often (e.g. original raw data), you probably don't need to track it in version control! Or, if your data changes less often than your code, you could track them separately, and could then use different access controls
-
If I have just local version control (i.e. set up with Rstudio), is that somehow backed up or can that only be done if committing to github? If I work with sensitive data I may not want the .Rdata uploaded remotely.
- Other clones of repo do nat have to be in GitHub or any public location. You can have your own GitLab, or just repo in another directory or machine (via ssh, etc)
- I'm not really sure what that means... to have a local repository is by default with an Rstudio project I assume. Then I would need to duplicate to another place locally?
- a local git repository (like you would have if set up in RStudio) keeps the version history - so you can revert changes to files if you make a mistake or accidentally delete something. BUT it isn't backed up elsewhere - so if you accidentally delete the whole project, you lose your project and its history. You can back up a git repo by making a copy on an online site like Github or Bitbucket, or you could also copy the directory manually to another local folder (but it won't automatically stay up to date)
- Ok that makes sense thank you. I suppose there must be a way to not include the data or only include scripts (git ignore?) when committing?
- Yes exactly - you can ignore specific files such as data! I think this will be covered later :)
-
GitHub vs Bitbucket? Pros? Cons?
- GitHub tends to have a larger community. Bitbucket has better integration (IIRC) with some tools. But, you can have a repository on both services, although synchronization can be a little tricky
- GitHub is more popular, has a huge community so making the collaboration easier.
-
Can't i do version control directly on github?
- yes, in principle you can develop your project only on github
- But then you might miss most of the tools that are available only on your computer. Most of the git workflow/tooling is also available on github (although not everything)
- you also loose the chance to work offline, and see detailed changes history when no network available.
-
Where I can find this excercise?
- look at the link below (clickable link in the "view only" view of this page)
-
I'm not sure I got what a "commit" is? I can see Branches, but I don't get where to look for the "commits"
- on github, there is a clickable link that looks like "XX Commits"
- commit is indicated by its id, i.e., hash which is something like
9ce4dce
- when you commit the changes that you have made to working files, git adds a new version to the repository. Commit is thus one snapshot, one version of the project. The default is to show the latest commit of selected branch
-
Recently there have been some controversies around GitHub, mainly in Europe. What is your experience with using european alternatives like e.g. Codeberg? +1
- I am using codeberg, it has all the basic features of GitHub but perhaps it is not yet polished as GitHub. It is perfectly useable though. Most of what you learn about github will apply there
- I heared that Codeberg lacks some features like "github
workflows actions", is it the case?
- if you mean "github actions", they offer an alternative technology, but I have not tried that. Notice that these "automation platforms" might need quite some computing resources, and CodeBerg might have less financial resources than Microsoft-backed GitHub. But there might be ways to support Codeberg.org
- Thanks. "github-actions" is actually the only thing that keeps me from switching totally, since its quite nice to have some cron jobs running automatically
-
I clicked on some squares (one on top of the others) sign and now the cilantro commit dissapeared from history in the guacamole recipe. How can I get it back? I was in blame view of the guacamole recipe file. When I was standing on top of the icon it said Blame prior
- It will just switch to the blame view at the timepoint of the commit that you clicked on (i.e., go back in history to that timepoint). It seems that it will keep operating on that view unless you remove the hash (long cryptic numbers+chars) from the URL. It might be easiest to edit the URL back to github.com/your-username/recipe-book and start over to get back to the general overview
- yes simply refreshing the blame view should solve the problem.
- perfect thanks!
-
I cannot search for "salt"- it shows me only a fruit salad or it says that something is being "indexed"? I am not sure how you get into this "main recipe book view".(I am also having same issue, let's wait for it to index i guess)
- The main recipe book view is what you get when you first open the repo. If you are searching your own fork, it will take a while for indexing, i.e creating a search base. After that has completed you should be able to search
- Thank you!
- You might need to use the "github search", go to the top-right corner of the github web page, click on the magnifying glass, you'll get something like "repo:<your-github-username>/recipe-book-recorded", then you just type "salt" - but you might still get the error "this repository's code is being indexed right now"
- Is indexing really supposed to take tens of minutes? It seems a bit excessive.
- GitHub is a shared resource, unfortunately sometimes actions take very long.
-
Perhaps elaborate difference between file copy of project directory, git clone of project, and fork of project?
- a fork is a copy of a repo from one github user to another github user; clone is a copy of the github repo to local machine
- a fork is a high level operation you do on github (or gitlab, or bitbucket) that involves and underlying clone, but still on the server. You can clone directly on your local machine, and then you have a copy (that can be synchronized with git pull and git push) that you can work on.
- just copying a directory with files in it might be doing something like "cloning" if you also copy the
.git directory in it.
-
If I don’t fork a repository but instead clone someone else’s repository, make changes to it, and then push those changes to my own repository, what problems might this cause?
- If you don't fork, but you still create a remote repository on github that you push your changes to, the problem is that from your github repository you will not be able to open pull requests to the original repository, because they are not in the same "fork network" (if I understand correctly your question).
- Does that means that I can only access the version of the upsteam repository when I cloned it?
- The fork is just a convenient shortcut for "clone this repository and change its upstream to this new repository that I can edit", you can do the two steps manually if you want.
- Thank you.
-
Will next session start at 14:00?
- In 5 minutes we will get back to the stream (see below)
-
This might be a stupid question, but if you are working on a secure env, as is the case with Finnish register data, how do you use version control? My expereince is that these envs are isolated from the internet
- I will copy your question to the bottom of the note document, so other helpers can see it (I am not the right person to answer this). It is better to add questions at the end, even if we moved to a different topic, so helpers can find them (too many people commenting, which is great but we don't want to miss any questions :) )
- write here something if you can't find it below, someone is already answering.
Goal: Browse a project, explore commits and branches, look at the network graph...
-
are those commits too simple? just "clarify" or "simplify" seems like any thing ahppened.
- there are conventions that we will cover tomorrow (see the answer to the next question too). If it is just "clarify", it might be too simple, it is usually good to be slightly more descriptive (for example "clarified ingredients").
-
is there a standard for commit language? max length, I have seen some tags like refactor, feat, fix...
- yes, there are some conventions. We will cover it tomorrow. Basically, commits always include like a short message line on top, and then the body below, which helps to inspect the history of the project later. Depending on a team, you may indicate what the commit is about by using something like "fix: commit message"
- its better to usually consider not long commit messages ( something around 50-70 characters is good), this make the history more readable and clear, also easier for further collaboration with team.
- You can also add a longer description (i.e., commit message is a short description, but then you can have a longer explanation as an additional, more exhaustive description)
-
When I'm trying to search which recipes include "salt", I get an error message: "This repository's code is being indexed right now. Try again in few minutes". What does this mean?
- It might happen that the search base for your fork is not yet created (it can take some time for GitHub to set up the indexing). Try again in a bit.
- It works in command line.
-
what is the the "network grap"? where do I find it? and the branches?.
- on the top (in the menu where there is
Code, Issues) go to "insights" -> "network" on the left.
- I am totally lost.
- When you open the repository, you have one line that starts with the github logo, which tells you which repository, and after that
Code, Issues etc, which are essentially clickable links, though they don't look like it.
Also, we will show the exercise solutions, and if you are lost and want to skip to the next exercise, there are solutions after the exercise
-
We have a learner using an old MacBook air (intel probably) without enough disk space installing Xcode when following the git installation. Any recommendation?
- so
xcode-select --install did not work? is brew available on this machine?
- Unfortunately all of the alternatives still need Xcode commendline tools which require quite a lot of disk space when never used.
- Did you try macports?
-
Why in the Blame view, we see the commit 'drafting a guacamole recipe' twice?
- could you provide a permalink :)
- e.g. here? https://github.com/cr-workshop-exercises/recipe-book/blame/9ce4dced2d2560ba6c7fa26e81fca3714ba3ba0f/sides/guacamole.md#L1 and also in line 12 https://github.com/cr-workshop-exercises/recipe-book/blame/9ce4dced2d2560ba6c7fa26e81fca3714ba3ba0f/sides/guacamole.md#L12
- I think this is because both of those lines were last changed in the same commit
- yes, it appears twice because it is showing you the changes per line, and different lines where changed in that same commit (with other in the middle changed in other commits). Confusing but hopefully makes sense :)
-
how to look for the recipes including the ingredient “salt”?
- if you are in the landing page of the github respository, just type
/ and the search term
- if you are not, there is a magnifying glass icon at the top of the page
this shows two recipes with "salt" but there are more, like ...
-
the Guacamole recipe received 4 changes?
- 4 changes after its creation, that is correct =)
-
What happens when you blame somebody in the code repo?
- In this case, "blame" is a noun not a verb / not an active process. The "Blame" interface shows you who made the last change to each line (and the commit message), but it doesn't do anything else. So don't worry, it's not going to send that person an email saying "you broke the code" or anything like that! "Blame" is maybe not the nicest way to frame this
- yeah, native Git uses the term "annotate", which is perhaps nicer :) :+1:
-
Is it possible to commit only parts of files in a directory to a repository? Ie: working in RStudio on a dataset, what if I want to version the code, but dont want to copy the dataset to github.
- yes, on your local computer, you can:
- from the command line use
git add -p (where -p means "patch"), and you will get an interactive prompt where you can chose what to add.. more on that later in the lesson.
- Probably RStudio has also a way to do the same but from inside the editor (many editors/IDEs have that)
- I think this question is about commiting only some files in a directory, rather than only some parts of files
- That is typically the default. If your files are small enough, typically you can just
git add all the changes to particular file that you changed... but this will be discussed later in the lesson.
- If you are working in an .Rmd or .qmd file where you generate an output .html file combining code, plots, and output, what I'd recommend would be to only commit the .Rmd/.qmd file to git, and exclude the .html file using a .gitignore file. This would mean your code is tracked, but any potentially sensitive data in the output/plots is not added to git
-
Is it common to use creative commons licences for code? When are code licences useful?
- it's not recommended to use creative commons licenses for code: https://creativecommons.org/faq/#can-i-apply-a-creative-commons-license-to-software
- one reason is that (depending on the programming language) you can distinguish between source code and compiled code - CC licenses don't mention this distinction. Other reasons mentioned there include that CC licenses don't mention patent rights, which can be important for code
- it's better to use a license that is specifically designed for code, to make sure it covers the most important things for code
- CC licenses are mainly for text or images or like media. for code, people mainly use license such as MIT, GPL, or Apache.
- This is a nice website for learning more about different code licenses: https://choosealicense.com/
-
When using gitignore, do i put make this as a directory, or is it a text document to list the files to "ignore"?
- it is a text file called
.gitignore that lists the files (or filename patterns) to ignore. You can have one .gitignore file per directory,
-
But it is possible to change your commit message afterwards, right?
- you can, but it's a bit cumbersome... and it gets more complicated if you also shared already the commit (you "git push"-ed). If it's just the last commit and you haven't pushed anywhere yet, you can change the commit completely with
git commit --amend.
- in theory, you can modify the commit message on your local machine and force it to github so that it is also updated there. BUT this is dangerous as it can mess-up with the history and repository of your collaborators who may have downloaded the repo before you modified the commit message. So doing this only locally, before the push is all fine, I think.
-
So talking about versioning locally vs on github, as long as you avoid 'push' you can do everything fine locally? THis is what a quick google tells me, and I am interested in saving potentially sensiive data from exposure to github.
- yes, you can work only locally. depending on what kind of sensitive data we are talking about you can use a git-extension like
git-annex and upload your sensitive data to a trusted server outside github even though your code is stored on github. I believe we will talk about it next week.
- I am referring to sensitive patient data.
- in general, github (or other platforms like gitlab) are for storing code (there is a size limit on your repository). if you would like to store data that you wish to version, there are other alternatives (git-annex, DVC).
- I want to version the code, not the data - I just ask because often this metadata will be stored in the same directory as the Rproject itself. (So I suppose either you change that structure or you use gitignore).
- I see. in that case, best those "metadata" in a seperate file and list it inside
.gitignore so that your code itself does not include these sensitive metadata. does this help?
- Yes, thank you. I just have to be careful to verify what is in gitignore before committing (or push I suppose?).
- Yes. once you commit something it will be preserved in the project history
- I often use a structure where I have a project folder, then "data/" and "scripts/" folders within that. I can either just track the "scripts/" folder in git, or if I have other files I want to track too, I can exclude the whole "data/" folder in my
.gitignore. Maybe a similar structure would work for you
-
I get "0 files" when looking for "salt", although I get results, and when I count manually I do have 5 files where the word salt appears
-
desserts/pumpkin-pie.md
mains/vegetarian-lasagna.md
salads/mixed.md
sides/guacamole.md
soups/mushroom-soup.md
These are the ones that one can see.
- i see the same ones, but the header says "0 files", I need to count them manually, which is not what we saw on the livestream.
- Hm. I see 5 files. How does your search line look like? mine is
repo:<github-usename>/recipe-book-recorded salt
what happens if you refresh the page? +1
- that did the trick, thanks!; I now get the exact same results as before, but now the header actually reads the right amount of files, 5 instead of 0
- maybe you found a little bug on GitHub?
-
If I "fork" a repository in GitHub, and I "git clone" the same repository in bash cmd line in my local files, are these two considered different and separate repos? How will I make "connection" between them?
- forking a repository on Github and then cloning the fork you just made
to your computer is the "standard" workflow.
- if you fork a repository on GitHub, but then you clone the original repository, then your fork and the local repository on your computer are not connected. But you can connect them:
check the output of git remote -v in your terminal.
it should show the original repository, typically as the origin remote.
You can add another remote, with another name than "origin", or you can change the URL of the "origin" remote.
- add another remote, called "mine", rename as appropriate:
git remote add mine URL-to-my-fork
- change the URL of the existing "origin" remote:
git remote set-url origin URL-to-my-fork
Thank you. I did the second thing you said out of habit. Should conform to the standard flow.
-
What's the difference between "fork" and "clone"? When do you use clone?
- Fork is a copy of someone else's repository on GitHub which is under your account.
- Clone is a copy of a repository on your local computer, which give you the possibility to work offline and commit changes then via puish or pull. so Fork live on Github but Clone live on your machine.
- Note that if you clone someone else's repository and want to commit changes and push then back, it is only possible if you have permission to modify that repository. That is, if you want to make changes to a repository on GitHub that you don't have permission for, you need to create a fork and make your modifications there.
- someone else's repo --(you have permission to edit)--> you can directly clone and push back changes
- someone else's repo --(no permission)--> create a fork --> clone your fork and work on it
- So something like |github-repo1| --forking--> |github-repo2| --cloning--> |local-repo2|
- Exactly! If you would like to contribute to the original repo (that is, adding the changes make in your fork), there is a way to do this and we will see it on day 3 (and you'll be able to do the whole process above too).
-
This might be a stupid question, but if you are working on a secure env, as is the case with Finnish register data, how do you use version control? My expereince is that these envs are isolated from the internet
- You can run git locally and use it for version control that way. If you use command line to interact with the secure env, see if the command
git exists.
- The secure env might also have an associated git server (e.g. a local Gitlab instance), that you could use to back up your code - I'm not sure how common this is though
- the difference here is you still use offline version to keep track of project, but dont push that to GitHub anymore, instead you can use an internal Git server or other secure drives.
-
How can we do version control if we are using any secure environment to analyze data?
- The code should in any case be under version control. The data might be confidential/sensitive and might not be stored (unencrypted) in the repository, but still the code/scripts/methodology should be publishable along with any scientific publication you are going to make
- So this will be a portfolio rather than an active version control with team members for better data management?
- What I mean is that it makes sense to store data (which might be sensitive and needs to be kept private) and script/logic/code (which needs to be available for reproducibility, typically - your use case might vary but that's generally considered best practice today) in different ways. Git can be used out-of-the-box to keep code/logic/scripts under version control, other tools, services or extensions can be used to store sensitive research data.
NEXT week will discuss these aspects more in depth.
- Three examples of cloned projects:
- The main repo is in GitHub:
$ grep -m1 -A1 remote vertaa/.git/config
[remote "origin"]
url = git@github.com:jvlehtonen/vertaa.git
- The main repo is in another machine:
$ grep -m1 -A1 remote syngap/.git/config
[remote "origin"]
url = ssh://servername.somedomain/site/repos/git/syngap.git
- The main repo is eselwhere in "same machine":
$ grep -m1 -A1 remote bodil/.git/config
[remote "origin"]
url = /group/devel/gitroot/bodil.git
The version control is about whether/how you can access "older/other versions". That does not require clone of repo.
The cloning of repos allows having more than one copy / each user working on their own copy.
Even then the "main repo" to which everyone pushes their updates does not have to be in GitHub or any other public location.
-
How to save a change without it being a new commit? You mentioned that we could do that, but I don't see the option
- Do you mean add to a previous commit? (Committing essentially means saving in git). You can "amend" a commit, but I do not see a way to do this in the GitHub interface.
- Even the amend procedures differ depending on whether you want to modify the most recent commit in your local repo or a commit that has already been pushed to remote repo (e.g. GitHub)
- The remote repo should be "bare" -- sans working copy. Where is the "non-bare local repo" that GitHub editor lets you access anyway?
- You can "add" a change to git. This is usually used to select what to commit next.
- When using the editor or command line (we will demo this tomorrow), you can 'save' changes in a file without directly committing the changes, but I don't think it's possible on GitHub
- I think we will pick this up and address it on the stream after the break, this might be good to clarify for everyone. Thanks for the excellent question!
-
Will we go through the function of the tags later?
- Yes, we will show that and discuss that after the break =)
-
I've renamed a branch via VSCode, and then published that branch in the same menu, which created a new branch over on Github. How can I make sure that it stays one branch over on Github? (I forked the repo on Github and then cloned to my local computer so I'm having to use push and pull)
- You can delete the old branch name on GitHub. Would that work for you?
Branches are an extremely light weight "entity".
- I guess that works, I was just wondering if it can be done without the extra work (like if it were done on Github directly). But if not that's fine, that's also an answer to my question hahaha.
- This is actually an interesting question, I will ping someone that might know better how to do this...
- renaming branches locally is done with
git branch -m)
- doing this on github through a client like VSCode might require "talking" to github via their API, and there's an endpoint for that, but maybe VSCode does not use it?
- So I'm assuming that VSCode just runs
git branch -m under the hood, which genuinely renames the branch locally. When I check my branch overview on VSCode, it now shows two branches locally (main and renamed), and three on Github (main, old, renamed). So I guess when it pushes it, there's no way to tell github it's the same branch?
- That's my interpretation as well, althought perhaps VSCode uses something slightly different than the "command line git" (perhaps a library like libgit)
- The git output on VSCode shows
git branch -m apple-crumble-new-and-improved [29ms] so it seems to me to just be regular command line git (the entire output is just command line git).
- ok, thank you for sharing! In principle VSCode should do at the same time both the
git branch -m and the api call to github, but it's probably not doing that?
We could open an issue :-) .
- I'm seeing in the output that the Github Authentication isn't working on my side so that might explain. I mostly use gitlab for work so the setup might not be correct. Edit: fixed the github authentication, and it's still not syncing. It's also showing that the local branch has the new name while the remote branch has the old name.
-
I cannot see my commits in the Network graph. It also says 'Last updated about 2 hours ago.'
- It can take a while, some times. Do you see the changes in the main view (the file manager)?
- Also try to make sure that you can actually see the right most edge of the graph. It does not scroll for me, so I have to manually drag with the mouse to see the edge.
- I scroll to the end but I don't see the changes. They are visible everywhere else except the graph.
- Same thing happened to me, there was really nothing that seemed to fix it, except waiting for some time, eventually they appeared...
-
.Is it git chekout the same as git switch? is there any difference?
git switch is a newer version of git checkout; so, some functionalities overlap. git switch is specifically for operations with branches
git switch was added because git checkout is a command that does many different things and it's quite confusing. Naming things is hard :-)
-
Comment on modifying files on github.com directly: there is the option of using "Open with github.dev" to actually work on the whole repository in a VSCode instance that runs on the web. And then you could "save" the changes you do not want to really commit into a separate branch. But probably that's complicated?
- yes it works, but i assume it can get complicated for larger projects or maybe multiple changes, so its usually ok for small edits or quick fixes maybe.
-
Do you create the tag before commiting? It can actually be done after commiting the change?
- Tags are "tags" you attach to commits. So a commit needs to be added first. Branches are different, you can create them as pointing to an existing commit, but then when you add commits to that branch effectively you "move the branch" (the commit pointed at by the branch) to the next commit. With tags this is not possible, tags are attached to a fixed commit instead.
- In general, a tag marks a specific commit in history, such as the final version of your code used for the results of a submitted paper. you commit your changes first, then add a tag pointing to that specific commit.
- If you create a "Release" in GitHub, it creates a tag to that commit, so you can more easily later fetch/refer to the exact version that is in the release
-
How to integrate copilot to github? will it check automaically if there is any issue with our code?
- This topic will be discussed on Wednesday next week (Responsible use of generative AI in assisted coding session). What do you mean by "issue"? "issue" in the "github" sense, or more in general?
-
How do you find the 'compare' function on github?
- https://coderefinery.github.io/git-intro/commits/#compare-the-branches
A nice way to compare braches is to add /compare to the URL of the repository, for example (replace USER): https://github.com/USER/recipe-book/compare
- Does this answer your question?
- To me this doesn't seem to work with branches other than main.
- changing the URL seems to be the only way docs
- The link refers to a compare drop-down menu (which I've not been able to find)
- if you want to compare two branches, this is the patern for the URL
https://github.com/USER/recipe-book/compare/<branch-source>..<branch-target>
-
When comparing using GitHub, is it possible to compare both ways at the same time? That is, not swapping the branches and just have everything in a single window. It seems to be only one-sided...
- Not onesided. Say A has "cat" and B has "dog", The AvsB has then -cat, +dog, and BvsA shows -dog +cat ...
-- Right, but what about new files rather than lines in a single file that have changed? For example: main has a changed file but when comparing main <- new_branch, it does not appear and rather changes only from new_branch appear. I hope I am being correct explaining myself.
- new file would come up as a difference in all lines
-
.When I do git graph I get the following message:
git graph
git: 'graph' is not a git command. See 'git --help'.
The most similar commands are
branch
grep
Is it a version issue or I am missing any extension in VS COde?
-
I created a tag in the local copy of the repo after committing the changes to GitHub, so the tag does not show on Github. The workflow should be then modify file, create tag and then commit?
-
- You need to commit before creating a tag. You can also push that commit to github.
- Then you can create a tag
- You need to "push" the tag too, with the command
git push --tags
tags are not pushed by default with just git push
-
Did not quite get what is the use/advantage of the tags!
- It's a way to say that some commits are more important than others.
- A comfy alias. GitHub has text about semantic version numbers.
- Tags help to inspect the history of the project. Imagine. If you would like to go to a previous version of a project, it is easier to search through tags than all commits. For example:
git checkout v2.3 where v2.3 is a tag. Or even simpler on github website (next to branches)
-
Ok so commit is "saving " the changes under local git repo and pushing is uploading to Github remote repo?
- committing is like taking a snapshot of your working directory. You can commit either on github or locally. to see the new commit from github to local is called
pull, while the other way round: from local to github is called push
- THANKS :)
-
It seems that "Checking for the ability to merge automatically..." phase is taking very long //Refresing the page worked, thanks :D
- Try maybe refreshing the page? There's not much that can be done to speed up the github server (you could check locally on your computer that the merge could be done, following the "Local (VS Code, Command line, RStudio)" tab)
- GitHub server was slow on showing network graph too, so it is under load (for whatever reason)
-
I don't think so much time was needed for this step, I was basically able to follow during the demonstration itself.
- Nice :)
- Good to know! It really depends on where you are in your "learning git" journey, we like to make it slower the first day so completely beginners can catch up too. The deeper in the course we are, the more varied and complex the examples and content will get, please keep the feedback coming :)
- Total beginner here... still not done :D
- No worries, there is still time and we will review the exercise after the break :)
-
I have created a new branch on github, but the project i cloned on the local machine has yet been updated, do i do git clone again in cli?
- git fetch, then git pull to get changes that happened to the original repo to your local copy. It's good practice to do this before starting to work on a repo anytime anyway
- +1000 to this, I tend to forget doing this and make my life harder because of that (many conflicts on my back). So getting the habit of doing git pull each time is a great idea.
man git-pull states:
More precisely, git pull runs git fetch with the given parameters (and then either git rebase or git merge)
- the clone/fetch/pull/push copy content from one repo to another. Local repo can have different branches&tags than remote
-
At step 6 (Delete merged branches), my commits from the new-recipe branch disappeared. What could I have forgotten? [UPDATE: I am blind. There were not in the logs (git log --oneline) but I see them on the individual files. Please excuse me for the confusion! Thank you for your answers.]
- UPDATE: did you do 'git add'? You should still see the commit messages you typed in the output of
git log!
- Yes, I did. A comment below offered a solution with
git graph, which works perfectly.
- That's puzzling. Are you doing this on github? Is it the same repository?
- I did it using the command lines listed in the solution. It was in my forked repository.
- To me this seems ok. If the branch was merged to the main, then the commits of the old branch are gone.
- This is not what a merge is, actually. A merge never change the history, the past commits: it might create only new commits. Old commits should be visible as part of the story.
- I meant once the old branch is deleted.
- actually, no: deleting a branch does not mean deleting any commit.
- right, it probably just deletes the pointer
- exactly! The name "branch" is a bit misleading, because one thinks of a chain of commits, like a branch of a tree. But a branch is actually more akin to a "leaf", to keep the analogy.
-
When I try to create a pull request towards the original repository, even if I select only the new branch, the changes made in the "main" also appear in the commits that are listed in the pull request. How is that? How can I say that I just want the commits from that specific branch? I did not have the issue when pull the request to my own repository.
- We would need to see this, if you want you can visit the zoom room (zoom link sent yesterday) and the helpers there can check what is going on.
- Did you come to the room? If you did I had my headset turned off, sorry! Please pop down again
-
I think I did something wrong. sorry.
- We can help you :-)
- seems like I contributed to the main receip book.
- no worries, although I can't see any contributions there. Do you mind sharing a link?
-
I did the merge pull request, but when I checked the Network, the two branches I merged aren't shown as merged. Is that a normal behaviour? :)
- it probably will just take some time until the network graph updates - if you check later today or tomorrow you should see the merge!
- awesome, thank you! :)
-
That offer of pull request to project and licences ... say base has BSD and you propose a change that depends on GPL library ... would be "an issue"
- if one is like BSD and you propose changes that depend on GPL then you'r introducing license incompatibility, which would be an issue, is that answer your question?
- Not really a question. More a conclusion. Licenses are for another day?
-
I can't make my repository private, the option is greyed out
- I think there were recent changes in GitHub, but if you have a "academic/student" account (= you added your university email to your github account), then you should be able to create private repositories.
- I did use my university email so it must be some other reason.. Or is academic user a selction I can make in my account?
- you need to explicitly apply for it https://github.com/education
- I am checking... their terms of service changes fast sometimes :)
- It's not automatic - you need to request the academic/student account privileges! Here for students: https://github.com/education/students or here for teachers/academic staff/etc: https://github.com/education/teachers
- You may also not be able to make the repo private if it's a fork of a public repository
- https://docs.github.com/en/get-started/learning-about-github/githubs-plans in theory everyone should be able to create private repository, so I am not sure why you cannot (and to make sure... this is a new repository, and not a fork. All forks of public repositories are always public.)
- I can confirm having regular account that it is possible to create a private repo
-It is probably because it is a fork of a public repo then. Thanks!
-
I am using source quality for twitch, but it is really blurry for me. It was fine earlier. Anyone else with this problem?
- it's ok on my side (might be a temporary connection problem)
- also a bit blurry for me -- maybe due to my network...
- is it still blurry for you? It was blurry only for a moment at the broadcasting room
- Still blurry, and has been for abt 30 mins
- same here
- did you try refreshing the page?
- refreshing did not change anything for me. but this is all fine. just a comment
- thanks for telling us!
- are you using source quality?
- yes, must be the network
- ha, weird, that should solve the issue... sounds like a network problem then, sorry about that
- There is always some residual blurinnes because the instructor's computer gets resampled to a smaller amount of pixels. So we don't stream 4K. It also means you have good vision :D
- For me (op) it is extremely blurry, my glasses doesn't even help! I struggle to read it. Hopefully tomorrow will be better :)
- some things to try: 1. do you have any browser extensions active that might interfere with the twitch user interface? So maybe the "source" setting is actually ignored. 2. what is your connection speed?
-
I can't find a 'Delete branch' button in my newly merged branch request?
- you should be able to delete branches from the list of branches in your repo (you can get to this by adding /branches to the URL or by clicking on "N branches" on the main repo page) - on the right, for each branch, there's a bin/delete icon
-
Will we cover how to roll back to a previous point later?
- this optional episode https://coderefinery.github.io/git-intro/recovering/# might help.
- There are many ways you can "roll back to a previous point":
- git reset
- git restore
- git revert
And possibly others. These do different things, though.
The main point is that git stores all the versions of the data
necessary to do all these revert/restore/reset operations
-
How are we getting the notes?
- Notes will be part of the main workshop webpage after some cleaning and checks: see https://coderefinery.github.io/2026-03-17-workshop/questions/
-
Can anyone use hedgedoc? For teaching etc?
- Yes, you can host your own: https://hedgedoc.org/
If you had/have issues with the installation, we will provide a 1h support zoom session tomorrow morning 9:00 CEST (Oslo/Rome). More info in via email. Let us know if this is useful with some emojis.
Twitch will store this video for 7 days, and hopefully it will be on YouTube by the time that expires.
Day 3 is when we will collaborate together and we will send you detailed instructions on how to do that via email later today.
too fast:
too slow: oooooooooooooo
right speed: ooooooooooooooooooooooo
too slow sometimes, tooo fast other times: ooo
too advanced:
too basic:
right level: ooooooooooooooooooooo
I will use what I learned today: oooooooooooooooooooooooooooooooooo
I would recommend today to others: oooooooooooooooooooooooooo
I would not recommend today to others:o