Git is the de facto standard for backing up and sharing your work and collaborating on projects. It is a great tool to have in your tool box.
Unfortunately (fortunately?!) it was developed by Linus Torvalds - the extremely capable programmer behind the Linux kernel. It packs a lot of power, but no one ever referred to the interface as well designed. There is a bit of a hurdle that needs to be overcome to get started, but very soon using git becomes second nature, nearly automatic.
This Monday 06/04/2020 at 11 AM PDT I will hold an intro session to using git and github. This is what we’ll cover:
Git for an individual
** why use it?
** how to create a repository? making commits and pushing to github
** how to work on an experimental feature?
** how to restore your work when something goes wrong?
Git as part of a team
** what are pull requests? how to create them
** git remotes - magic or madness?
How to get out of trouble? The most important command no one knows about
Where to go next?
I would ideally like to use the zoom room we have for the class. Do we still have that going? Does anyone have a link to it? If this is unavailable, or people are busy discussing something else there, I will post a different zoom link in this thread before the session starts.
Let’s have a hard stop at 12 AM PDT - we’ll see how much we can cover. Hopefully everything, but if not we can pick up at a later time.
Edit: Here’s the Zoom Link to Join the call, meeting password: 675028 (Note, please @init_27 if you have any troubles joining the call)
I would like to encourage conversation and keep it really low stress for everyone, so please do not record the call, would like everyone to feel at ease.
But if there will be more people interested in participating in a session like this, I am happy to field another call at a time that would work for them better. We could do something on a weekend and at a time that might work better for other time zones.
Reminder-Note(2): The session wasn’t recorded so that it remained an open call.
I noted some questions/tasks, I’ll share them so that you can check what your learned in the session, these are very beginner friendly, spend a few minutes reading:
What is git?
What is GitHub?
Why use them?
Where can git save your life? Radek shared an example. Do you remember?
Task:
Make a folder, create a few files (Don’t use GUI even if you’re tempted to )
Initialise the project as a git project/dir
Where is the git file?
Check status of the files.
Tell git to track the files! (Hint: add)
Now check the status, what does it tell you? Why?
When we commit the file, where does it get “committed” to?
How do you hide some secret that you accidentally added and go back in time?
How do you return to “present” state?
How do you create a new branch?
Radek shared a magic trick to check out the previous branch that you were on before. Do you remember?
Merge branches and check which one did you delete
What’s a merge conflict? Why does it happen? How should you fix it?
Why does git not see a directory?
What is a remote?
What’s push? What are we pushing from where to where?
How to generate and setup your SSH keys so that you don’t have to add your password and login every time?
Practise making a new PR to a repo.
Be nice to leave a comment in the PR, why do you want to suggest changes/etc.
Thank you @radek for this amazing initiative, it was really awesome
Thank you very much Sanyam for your super kind words
In the heat of the moment I forgot to share the one command to rule them all! If you or your colleague ever gets into serious trouble and it seems that work has been lost inside a git repository , try this:
git reflog
this is like git log but tracks way more actions. If you mess things up badly, navigating that very detailed history of your repository (beyond what appears in git log) can help you recover work that seemed to be lost forever
Thanks very much Radek. That was super useful. I’ve been a very tentative user of git, now I finally feel like I have some idea of what’s going on!