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 ?

  • rozodru@piefed.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    16 hours ago

    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.pubOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      15 hours ago

      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
        link
        fedilink
        English
        arrow-up
        2
        ·
        10 hours ago

        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.

          • rozodru@piefed.world
            link
            fedilink
            English
            arrow-up
            2
            ·
            10 hours 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
        link
        fedilink
        English
        arrow-up
        2
        ·
        12 hours ago

        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.pubOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          12 hours ago

          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
            link
            fedilink
            English
            arrow-up
            1
            ·
            11 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.