this post was submitted on 16 Jun 2026
9 points (84.6% liked)

Explain Like I'm Five

21421 readers
90 users here now

Simplifying Complexity, One Answer at a Time!

Rules

  1. Be respectful and inclusive.
  2. No harassment, hate speech, or trolling.
  3. Engage in constructive discussions.
  4. Share relevant content.
  5. Follow guidelines and moderators' instructions.
  6. Use appropriate language and tone.
  7. Report violations.
  8. Foster a continuous learning environment.

founded 3 years ago
MODERATORS
 

https://www.theodinproject.com/lessons/foundations-git-basics this is the lesson that i am following. I completed the Create the Repository section successfully. I also completed the Use the Git Workflow section successfully. It's the Modify a File or two where I am facing all the difficulties.

Can someone please show me the way how to do it ?

top 27 comments
sorted by: hot top controversial new old
[–] HeHoXa@lemmy.zip 3 points 4 hours ago

When I first started using Git, I was still in a phase where I wanted to completely understand every piece of tech I used inside out and upside down, line by line, function by function, every possible scenario.

Git is the thing that broke me of this habit. Never open the .git folder

Just learn the bare minimum handful of commands you absolutely need to get changes in, and manage the rest through the web ui

git clone [url] pull the repo to start. If you started locally, set up and clone the remote repo, then paste the files into the cloned dir

git add -A register all files in the dir for change detection

git commit -m "[message]" commit changes to those files locally

git push push the local changes to the remote repo

git fetch pull branch data from the remote repo (where you've set up branches in the web ui)

git checkout [branch] swap to another branch. Any pending changes should be pushed or dropped first. Drop with git checkout .

Be very liberal with copy/pasting the whole solution out and in to overcome complex situations. Deleting the .git dir inside will detach the files from version control.

There are many desktop UIs that a lot of my peers like. The one baked into VSCode is nice. There are also many more elegant commands to overcome tricky situations. I never use them. Just the CLI and these few simple commands are enough to get whatever I need done and avoid butchering my history.

You'll also need to know how to associate your local git client with your remote account, which I have to Google every time. Use SSH wherever possible because of how much smoother it is for the CLI. There's a config flag to disable ssl checks for https commands that comes in handy in some corporate scenarios.

Probably not great advice, but I think fairly practical advice. Use at your own risk.

[–] CameronDev@programming.dev 4 points 8 hours ago (1 children)

Could you narrow down which part is not making sense?

Which step are you struggling with?

[–] TheViking@nord.pub 2 points 7 hours ago (1 children)

If you click on the link, you'll come across a section called modify a file or two. That is where my problems begin. So far, l've been working on my WSL terminal.

[–] CameronDev@programming.dev 3 points 7 hours ago (1 children)

I did, there are multiple steps, which one is holding you up?

[–] TheViking@nord.pub 0 points 7 hours ago (1 children)
[–] rozodru@piefed.world 3 points 6 hours ago* (last edited 6 hours ago) (1 children)

so all it's saying is open README.md and add something to it then save. Are you getting hung up with "use code ." as the example?

literally all you have to do is open the readme, add something to it like "hello world" or whatever, save it, do git add . then git commit -m "edited README.md" or something. git push. done.

IF you haven't made a README.md yet then in your terminal just do "touch README.md" within your repo, then using whatever editor you use open it and do the above.

[–] TheViking@nord.pub 1 points 5 hours ago (2 children)

Exactly, this use code. I opened this lesson, and did everything on my WSL terminal. So far, so good. But when it's this switching over, that's creating the problem. Ideally, the readme.md has already been created by the time l reach here or no ? If not, where do I create the readme ? In the WSL terminal or the vs code terminal ?

Yesterday, l had made an attempt at it, and this was what my vs code terminal showed me : https://retrofed.com/post/1259307/comment/1601827#comment_1601827

You see the result in the pic of this post. Today l worked it up again, and today vs code gave the same result. Then l downloaded git separately for windows, and then configured it on vs code. I don't know if l have done it in the correct way or not.

Anyways, l've shut down my system, and l shall look into it again tomorrow.

What a struggle trying to grasp a new idea !!!

[–] rozodru@piefed.world 1 points 1 hour ago (1 children)

wait WSL Terminal? so you're using the Windows Subsystem for Linux?

I think you're making this harder on yourself than you need to. It's like you're trying to use a saw to cut a piece of wood before knowing what wood even is.

I'll be honest with you, don't use VS code, you're not ready for it. All you need right now is quite literally a regular windows terminal and a basic IDE. notepad++ or sublime text. ONCE you've learned the basics you can go back to VS Code, that VS Code terminal is gonna mess you up.

A. make sure you have git installed just open your windows terminal and do winget install Git.Git

B. again in the regular terminal navigate to your repo you've created.

C. open notepad++ or sublime text or whatever basic IDE you picked and create a README.md and save in your repos directory.

D. back in your terminal do git add . make sure you have a space between add and .

E. then do git commit -m "initial README.md commit"

F. finally do git push and you're done. you can then check it with git status and it'll show there's nothing to commit, everythings up to date.

I think the tools were messing you up. I don't recommend VS Code for beginners, it messes them up. keep it simple for now.

[–] TheViking@nord.pub 1 points 1 hour ago (1 children)

Somebody suggested me eclipse ide just now.

[–] rozodru@piefed.world 2 points 43 minutes ago

don't. Eclipse is slow to start, it's heavy, and the interface is garbage. Honestly just go with Notepad++ or Sublime Text or even Zed.

Trust me I've been a web dev for 25 years, you don't need all the bells and whistles right now. you literally just need a notepad and a terminal.

[–] Muehe@lemmy.ml 1 points 2 hours ago (1 children)

Ideally, the readme.md has already been created by the time l reach here or no ?

Depends, if you followed the tutorial precisely it should already have been created in the step "Create the repository 3.". You can use the ls command in the WSL terminal to see if it exists.

If not, where do I create the readme ?

In the base directory of the git repository you cloned from Github. You can do so with the command echo "blaaaa" > README.md (this will overwrite the file if it exists already).

In the WSL terminal or the vs code terminal ?

See I think this is your misunderstanding right here. The tutorial tells you to enter code ., where code means "start VS Code" and . means "in the current directory". You are supposed to then use the file explorer inside VS Code to select the README.md and modify it.

This may not work as intended in WSL. If you enter which code and there is no output it won't work. Is there any reason why you are using WSL instead of just installing git for Windows? It comes with a terminal emulator, so there should be no problem following the tutorial and you can eliminate WSL as a possible friction point.

[–] TheViking@nord.pub 1 points 2 hours ago (1 children)

Thank you very much. I shall try tomorrow again. If WSL is not required, l won't use it tomorrow. Now that l have installed git for windows, this entire work can be done on the terminal of vs code ?

[–] Muehe@lemmy.ml 0 points 2 hours ago

Theoretically yes, but I would recommend the terminal git brings with it. You should be able to just open any location on your drives, right-click, and select "GitBash here". This will start a terminal with the directory you were in as the working directory.

[–] swicano@programming.dev 1 points 5 hours ago (1 children)

Can you explain what your overall goal is? By the looks of your recent post history, you seem to be overloading with new things. I would mention, if you're just trying to learn git, there are windows ways you use git, so you don't also have to learn Linux at the same time. I used tortoisegit for a long time, and github has an app. If you're trying to learn programming in general, I would just use vscode in windows and not worry about git yet. Do you have a concrete idea of where you want to be in X time?

[–] TheViking@nord.pub 1 points 2 hours ago (1 children)

I'm doing the Odin Project course. I found it very useful for developing an overall idea regarding programming. But l am focussing on git because I wish to develop new things and collaborate on interesting projects.

You asked a very nice question indeed. I come from the arts background with no knowledge of science and technology. But life places you in weird positions. I don't have any faith in the education system anymore, even though my brother is a teacher. And l hate big corporates. I believe that in the future, individuals would co-operate so far as work is concerned, and things of value would get created. We would be making things for our own needs, and people would help in this making process to alleviate their creative urge.

Do l make any sense to you ??

[–] swicano@programming.dev 1 points 1 hour ago* (last edited 1 hour ago)

No that makes a ton of sense. I do definitely worry that you're taking on too many complex adjacent things at once then. I myself use docker containers inside WSL to do dev work with Git and all these various things on a daily basis, but it took me a few years to feel comfortable like this. I think I would suggest you focus on the coding (python, javascript, etc etc) first and if it's something that you can do in windows using just vscode, thats going to have less friction than trying to learn git at the same time as trying to learn command-line Linux. And once you feel comfortable with vscoding in windows, swap over to vscode in wsl, that way the IDE (vscode) is still familiar, but now you're layering on the next level. And honestly, Git is pretty low on the stuff to learn. I know entire companies that do software version ingredients and sharing via email (aka, when Bob updates code he and Alice both use, he just emails her a copy) crazy, but it works for them.

On the other hand, this Odin project looks pretty well set up so that maybe after a couple weeks of feeling terrible, you pop out on the other side where it took me years to get to!

[–] slazer2au@lemmy.world 3 points 8 hours ago (1 children)

Create the README.MD with touch and open the file with nano or your editor of choice.

touch README.md
nano README.md

Add

G'day git

Exit nano with CTRL X then press Y to save the file.

[–] TheViking@nord.pub 1 points 7 hours ago (2 children)
[–] slazer2au@lemmy.world 2 points 7 hours ago

Assuming you are using the default layout. Right click on the folder structure on the left panel and select new file.

[–] OhNoMoreLemmy@lemmy.ml 2 points 7 hours ago* (last edited 7 hours ago)

Then use it to save a READEME.md  file in the git repository directory.

[–] mhzawadi@lemmy.horwood.cloud 2 points 8 hours ago

whats the issue you have?

[–] pseudo@jlai.lu 1 points 8 hours ago (1 children)

Git is about having a version of whatever project on a file in your computer (the file is called "local repository) and periodically synchronised its content with a remote file called central repository who is accessed potentially by other that you.

The first step is to make sure you have git, the software, on your computer and that you have access to a central repository, here GitHub where you need an account. Have you done that?

[–] TheViking@nord.pub 0 points 7 hours ago (2 children)

I already had git installed in my WSL. Today l downloaded and installed git in my windows 10 as well. I also have a GitHub account.

[–] davidagain@lemmy.world 1 points 1 hour ago (1 children)

GitHub desktop takes the learning out of git. You press buttons. It does its thing.

[–] TheViking@nord.pub 1 points 53 minutes ago (1 children)

I do have GitHub desktop, but haven't used it yet.

[–] davidagain@lemmy.world 1 points 41 minutes ago

Muuuuch easier than learning git.

[–] pseudo@jlai.lu 2 points 7 hours ago

So now you need to connect Git (the software on your computer) to GitHub (the internet site that will host the central repository). That is done using the command

git config

And giving it your github credential as mentionned in the Setting Up Git lesson that is link in the lesson you are following.