Explain Like I'm Five

https://www.theodinproject.com/lessons/foundations-git-basicsthis 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 ?

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 pending changes 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.

2 replies

What is it saying in my terminal ?

13h 37m ago by retrofed.com/u/LoveEspresso in explainlikeimfive from retrofed.com
-7154

How can someone sell rights to their life story or experiences?

2d 3h ago by feddit.org/u/PhilLab in explainlikeimfive
13106

How come we don't have tags it would work great in our c/askhistorians sub?

29d 4h ago by lemmy.world/u/Patnou in explainlikeimfive
11612

ELI5: What role could Agentic AI have in the future, and how should individuals prepare?

2mon 1d ago by mander.xyz/u/tristynalxander in explainlikeimfive
-31620

Why can't inflation be stopped by just printing less money?

2mon 29d ago by lemmy.world/u/IndigoGollum in explainlikeimfive
432232

Can someone explain the Save Act and how its not like jim crow era regulations?

3mon 2d ago by lemmy.world/u/Patnou in explainlikeimfive
20436

How to prevent your phone from being opened forcefully

3mon 21d ago by lemmy.zip/u/adelinezade in explainlikeimfive
392238

Why is China selling US treasury bonds worrying?

4mon 15d ago by feddit.org/u/benSunshine in explainlikeimfive from www.idnfinancials.com
631244

What did Donald Trump mean by "You won't have to [vote] anymore"?

4mon 19d ago by lemmy.zip/u/dandylion in explainlikeimfive
431445

ELI5 How is this legal? Doesn't the constitution give us the right to tell them piss off?

4mon 26d ago by lemmy.world/u/Patnou in explainlikeimfive from www.yahoo.com
34313750