DEV Community

The No Jargon Guide – Article 1 – Git & GitHub

lauracharvey on July 29, 2020

Table Of Contents Introduction About this Blog Notes for the Reader The Real Juicy Stuff What Even Is Git/GitHub? What Is Version Con...
Collapse
 
waylonwalker profile image
Waylon Walker

First Article got the git badge! Congrats, thats no easy feat. Well done

git badge

Collapse
 
lauracharvey profile image
lauracharvey

Thanks! I’m very proud of my Git badge!

Collapse
 
waylonwalker profile image
Waylon Walker

Wear it with pride! It was well deserved!

Collapse
 
greeder59 profile image
Gordon Reeder

Hi Laura. Great article.
A couple of things:

  • In Debian based Linux distros you can install Git with the 'sudo apt install git' command.
  • When starting a local repo (git init) be sure you are in the projects parent directory (for fesoQue)
Collapse
 
lauracharvey profile image
lauracharvey

Thanks for the comments!

Will people with Debian based Linux distros know what you mean by that? Or can you explain to me what that means/what its good for?

Cheers :)

Collapse
 
greeder59 profile image
Gordon Reeder

Yeah. right after hitting the Submit button I realized what I had done. You wrote a beautiful non-jargonized (is that a word?) article and I went and replied with a bunch of jargon. D'oh!
So anyone who needs to know will understand the jargon that I spouted.
How much do you know about Linux? I don't want to be caught mansplaining.

Thread Thread
 
lauracharvey profile image
lauracharvey

Haha you just made it a word 🤷🏼‍♀️😂 no worries. I know nothing of Linux but I’m happy to include a little snippet if it’ll be helpful to Linux users! You can DM it to me if you’d prefer? 😊

Collapse
 
keke_arif profile image
Keke Arif • Edited

Nice article Laura! Only suggestion I have is that you could just past the code from the terminal into a tool like carbon.now.sh and make those screenshots prettier. e.g. dev-to-uploads.s3.amazonaws.com/i/...

Collapse
 
lauracharvey profile image
lauracharvey

Thanks so much I'll have a look into that :)

Collapse
 
muniro profile image
Muniro

Hey Laura, great article. Minor things. When you do Cd (Change Directory) it usually is backslash like cd C:\myfolder. With Git Add . you are showing how to add all the files that are "untracked". You can also show Git Add "filename" - to only add certain files. Other things to bear is how can you create a Git Repo on Github, and then add local files to the staging and then push the items to remote. You must tell git where is the remote repo. Also, Git works by a way of messages - ie. messages or comments are important, so that's why when you commit, a comment is needed. The good practice is to ensure comments are present actions, so instead of "added config files", should be "adds config files". It is more useful when you look for any issues in the repo and the message are present tense. There is also the git log message to view history of your commits and where your current branch is. These are just pointers. I think your article is impressive. Enjoyed reading it.

Collapse
 
lauracharvey profile image
lauracharvey

Thanks for the feedback 😁

Collapse
 
fesoque profile image
fesoque

As someone new to web development(started 2 months ago), i find Git/GitHub scary as I never knew how they work... I must say, I'm lucky to come across this post😊as it relieves me from my fears and anxiety of understanding Git/Github... I'll definitely try to push this project I just completed to GitHub following the steps you highlighted. Thanks!

Collapse
 
lauracharvey profile image
lauracharvey

Yay!!! I love this! So glad you found my guide and really hope it helps you creating your first repo. Any questions please get in touch 😁

Collapse
 
fesoque profile image
fesoque • Edited

Hey Laura, if you don't mind, I have a dumb question to ask:

  • I just completed a project and I'd like to push it to Git/GitHub, which of the project files is meant to be pushed-- the HTML file, CSS or both ??
Thread Thread
 
lauracharvey profile image
lauracharvey

Hey!! There are no dumb questions 😁 all the files related to that project that are needed to make it work or needed for someone looking to fork it should be added/pushed 😁

Thread Thread
 
fesoque profile image
fesoque • Edited

Thank you Laura... How do I go about a situation where I have my HTML files in the parent folder and my CSS and JavaScript files are inside subfolders (Stylesheet folder and script folder) in the parent folder...

Can I target the respective files I want to push to GitHub without pushing my whole project folder as it contains other files, like this?:

C:\Users\yourname\OneDrive\Desktop\Project\index.html

C:\Users\yourname\OneDrive\Desktop\Project\StyleSheet\main.css

C:\Users\yourname\OneDrive\Desktop\Project\Script\demo.js.

-If your answer is yes, can I push them at once or I have to push the files three times considering the fact that they are in different subfolders.

Thanks always!!

Thread Thread
 
lauracharvey profile image
lauracharvey

Hmm that’s a toughy! Do they need to be in seperate folders? Or could you have all 3 files that you want to push in the same folder? If you want to keep them seperate that’s fine I think you would need to do a push for the parent to a new repo and then you can create sub folders to that parent repo! 😁

Thread Thread
 
fesoque profile image
fesoque

Ok thanks

Collapse
 
hjplumtree profile image
HeJ

Hi Laura, very helpful guide! I come here many times to check ;)
on this part
'8. THE REALLY SCARY ONE Type: git push origin main'
Do you know why 'git push origin main' didn't work but 'git push -u origin master' did for me?

Collapse
 
lauracharvey profile image
lauracharvey

Hey! Thank you! I have to admit I'm not entirely sure, -u generally means update so could it be that you'd already updated once? I notice in the first statement you've used main instead of master was that just a typo?

Collapse
 
hjplumtree profile image
HeJ

I'd used it right after 'git remote add origin'.. Oh yeah maybe it is all because of 'main', it should have been 'master'.
Then Laura another typo alert, there's another 'main' in 'YES! I DID IT! BUT WHAT DO I DO NOW?!' section :)
Did you update a page?? I thought I was in different page! looking good!

Thread Thread
 
lauracharvey profile image
lauracharvey

Haha yes I updated it! Thanks for letting me know I’ll get on to that now! Sorry for any confusion caused 😁

Thread Thread
 
hjplumtree profile image
HeJ

Nah glad I contributed :p

Collapse
 
cjglen profile image
cjglen • Edited

Really helpful and well thought out post! I will definitely be using this as my guide. So many of the other tutorials and courses just expect you know what they are talking about.

Thanks so much Laura.

Collapse
 
lauracharvey profile image
lauracharvey

Glad I could help! If you get stuck with anything! Give me a shout 😁

Collapse
 
cjglen profile image
cjglen

Thank you 😊

Collapse
 
gnio profile image
Gnio

I started reading this looking for the moment I say: "screw this. I don't get it".

I'm surprised by the simplicity. Extremely helpful for a newbie like me, which English is not the first language.

Made my day. Thank you.

Collapse
 
lauracharvey profile image
lauracharvey

Yay! So so glad! That’s exactly how I felt trying to learn Git/GitHub so really pleased that my guide helped you understand! Thanks for reading 😁

Collapse
 
teresatetens profile image
Teresa Tetens

Hi Laura! I was struggling with Git as a novice. Then an angel on twitter recommended this article. Now I start understanding.

I think this no jargon series is so worthy because it encourages and stop the intimidated learner from falling apart. I cannot thank you enough.

Collapse
 
lauracharvey profile image
lauracharvey

Hey!! That’s exactly what I was hoping to achieve! So glad it was a help to you. I’ll definitely be writing more in the future 😁

Collapse
 
saenz profile image
Nelson Saenz

This an absolutely fantastic read. I'm a passionate but still very wet behind the ears git user. You cover the basics and then some in a thorough but still easy to follow manner. Thanks for sharing!

Collapse
 
lauracharvey profile image
lauracharvey

No worries at all! Glad you enjoyed it 😁 I think I’ll do a bit more on git later in my series so keep an eye out 👀

Collapse
 
nickytonline profile image
Nick Taylor

It's True - Dwight Shrute

Collapse
 
beejoy profile image
Bijay Rai

Hi Laura
Nice starter article for beginners. I'm also new to Git/GitHub and this one question I always have 'Do I need to create PR to push to my own repo?'

Collapse
 
lauracharvey profile image
lauracharvey

Hey Bijay
Thanks so much for reaching out. Can you just confirm what you mean by PR? I’m not familiar with the abbreviation.
Thanks
Laura 😁

Collapse
 
beejoy profile image
Bijay Rai

PR = Pull Request :-)

Thread Thread
 
lauracharvey profile image
lauracharvey

Ahh I understand now! Thanks for clarifying 😊 no need to create a pull request to add to your own repo. If you go to the section called “What’s Next?” In the article the instructions are there for adding/updating to your own repo.

1 git add .
2 git status (not necessary but good to check)
3 git commit -m “message”
4 git push -u

😁

Collapse
 
nickytonline profile image
Nick Taylor

Congrats on your first post! Looking forward to your next one!

1st place in Mariokart

Collapse
 
lauracharvey profile image
lauracharvey

Thanks 😁

Collapse
 
mazonthemoon profile image
Mary Ronan

Thanks for this...was really clear and easy to understand👍

Collapse
 
lauracharvey profile image
lauracharvey

No worries at all! Glad you found it easy 👍😁

Collapse
 
lauracharvey profile image
lauracharvey

Thanks for the detailed feedback that’s really helpful 😁

Collapse
 
an4s911 profile image
Anas Basheer • Edited

Actually the ‘-u’ in git push means ‘—set-upstream’

Collapse
 
lauracharvey profile image
lauracharvey

Thanks I’ll update that now 😁

Collapse
 
an4s911 profile image
Anas Basheer

Amazing blog, I loved it. 😍

Collapse
 
brianmmdev profile image
Brian Morrison II

This article is amazing. Thanks for sharing it!

Collapse
 
lauracharvey profile image
lauracharvey

Cheers Brian!!! :)

Collapse
 
chris13830450 profile image
Chris

This is amazing, saved me so much time googling jargon I didn’t understand.

Can’t wait for more of your blogs!

Collapse
 
lauracharvey profile image
lauracharvey

Thanks for leaving your feedback and so glad it helped 😁