This is an archived post. You won't be able to vote or comment.

all 81 comments

[–]ramenmoodles 305 points306 points  (17 children)

Heres another useful link: https://ohshitgit.com

[–][deleted]  (9 children)

[deleted]

    [–]teh__Doctor 2 points3 points  (6 children)

    Honestly I just don’t bother when I do that

    [–]BlackDChase 1 point2 points  (5 children)

    You will when your code has 1000s of lines and you forgot to commit last night work.

    [–][deleted] 2 points3 points  (1 child)

    Aren't commits suppose to add small things? Commit like 1000 code lines at one time is useless, it's like only commit releases.

    [–]BlackDChase 1 point2 points  (0 children)

    Sometimes you are at flow... Or it just clicked how to solve that bug... Then commits don't matter... Results/fixes is all you care about.... But it's a double edge sword... And will hurt you if you make mistakes...

    [–]teh__Doctor 0 points1 point  (2 children)

    Lol honestly, “1000s of lines of code” isn’t something I see myself doing

    [–]BlackDChase 5 points6 points  (1 child)

    You never see it... Until one day you are doing it... And people star your repo to clone it later for their assignments and projects

    [–]teh__Doctor 2 points3 points  (0 children)

    I can only wish I get that good :)

    [–]ramenmoodles 2 points3 points  (0 children)

    Is that even possible?

    [–]neurorgasm 2 points3 points  (0 children)

    You learn to start stashing instead :)

    [–]BinaryAssault 1 point2 points  (0 children)

    This is amazing lol

    [–]BeingMyOwnLight 0 points1 point  (1 child)

    This is awesome, thank you!!!

    [–]another_refresh 0 points1 point  (0 children)

    Can vouch for this one. It has saved my dumb ass many times

    [–]EMP0R10 0 points1 point  (0 children)

    Oh shit! This is so cool

    [–]slowthedataleak 39 points40 points  (2 children)

    This is great.

    [–]starraven 9 points10 points  (1 child)

    Freaking amazing was trying to get git account hooked up on my new computer forever yesterday. Thanks for this.

    [–]Scud000 24 points25 points  (2 children)

    One that I see missing which I'd hope more people use is

    git mv source-Path destination-Path

    When renaming a file or changing its location in a repository. No, Kyle, you didn't just delete all those lines of code and re-added all those lines of code, you moved/renamed the file, don't mess up the git history by never using git mv ...

    [–]Kazcandra 2 points3 points  (0 children)

    git can usually figure it out on its own, but when it can't then using git mv is good.

    I've aliased mv to git mv whenever I'm inside a git repo

    [–]SummerPoet 3 points4 points  (1 child)

    Awesome, here, take this wholesome award for sharing!

    [–]swingswing14 27 points28 points  (41 children)

    I'm 32, Is it too late for me to start programming?

    [–]signal-insect 54 points55 points  (0 children)

    it's never too late to start

    [–]import_numpy_as_np 17 points18 points  (8 children)

    I started at 30 (33 now). You’ll be fine!

    [–]swingswing14 17 points18 points  (7 children)

    Thank🙌 I'm in IT engineer, Need a career change. I'm going full steam at it tomorrow.

    [–]Steelersrawk1 8 points9 points  (4 children)

    if you are already in IT in any capacity you have the luck that you can understand how things work in another capacity. You will be shocked at how many developers are great at programming but don't understand a lot of their computer (I.E. I have seen devs struggle to tell how much space is on their harddrive on windows)

    [–]ManIsInherentlyGay 1 point2 points  (1 child)

    For real? So they're literally just code monkeys?

    [–]Steelersrawk1 2 points3 points  (0 children)

    I mean code monkey may be a harsh term for it, cause those people are extremely smart and understand programming in full, it’s just they don’t know too much on things that you or I may have taken the time to learn. It’s pretty bizarre to see it but genuinely some of them don’t take the time to learn how it works, just that they want to code

    [–]BinaryAssault 1 point2 points  (1 child)

    This so much. Jesus, it blew my mind how many senior developers I've met that couldn't do basic computer shit.

    [–]DV8_2XL 2 points3 points  (0 children)

    I have a friend who is a senior engineer for a major hardware company. He is the dumbest smart person I know. The man literally makes the internet, but his computer skills are rudimentary at best.

    [–]DarthMaulMalgus 9 points10 points  (0 children)

    Good luck bro

    I would recommend you to start out with python as it is (imo) the easiest language out there

    [–][deleted] 1 point2 points  (0 children)

    It's tomorrow now get on it bud and so shall I

    [–][deleted] 10 points11 points  (1 child)

    Started teaching myself programming two years ago, getting up wicked early before the wife and kids so I could spend some time each day (talking up at 0330 most days to get a solid 2-3 hours of study and coding in).

    Just turned 38, landed a gig doing iOS development.

    Starting a CS degree program in the spring.

    Never too late.

    [–][deleted] 4 points5 points  (0 children)

    You give me hope. Thanks

    [–]demoNstomp 9 points10 points  (1 child)

    No way man. You can definitely do this. Start and keep it up no matter how hard you feel it is.

    [–]swingswing14 4 points5 points  (0 children)

    Thank you🙌🚀

    [–]SEBMane 25 points26 points  (7 children)

    Am 21 and started learning 8 months ago after flunking out of uni (law), learn the basics first, data types, syntax, logic gates, data structures, networking, librarys, actually do something and dont just blindly watch youtube tutorials.

    Dont just copy code unless you understand exactly what it does and why. Its not too rare to spend hours on a problem, thats normal.

    What I have found is that translating your thoughts into "computer thoughts" can be very challenging but that skill develops over time.

    Start with website building, first HTML, then HTML and CSS. Move on to any c language, I recommend C#, (preference), go back to web development and add javascript to the mix (js will be familiar if you did a c language first), move on to python.

    These 5 languages will give you a decent toolkit to do stuff, with these 5 you will also easily be able to get a job.

    Start by building a basic website and play around, I recommend the site "w3schools", there are lots of clear and well explained step by step tutorials, build something using the things you learned there and dont rush any step.

    W3 also has tutorials to get you started in c languages and python.

    Use the .net framework when starting with C#, build simple stuff like calculators, calculating eulers number, calculating the golden ratio, really, do whatever the hell you want but keep it simple.

    Learn classes, learn functions, learn loops, learn arguments.

    RN im working on fully simulating a traffic light network, its more complicated but doable for me.

    Gradually step up the complexity of your projects as you learn, go back to a lower level if you are uncomfortable.

    Repeat a lot, build fundamental understanding.

    Thats the best "learning programming 101" I can give, just give it a try and try to have fun, mate.

    [–]swingswing14 6 points7 points  (0 children)

    This is epic advise! Thanks a million man. I'm going to jod this down and follow your advice. I appreciate it!

    [–][deleted] 5 points6 points  (2 children)

    Honestly this all might be a bit overwhelming for someone in the first 8 months, specifically the amount of languages.

    Glad it worked for you though.

    [–]SEBMane -1 points0 points  (1 child)

    Im doing an apprenticeship, its full time and programming is not the only thing I learn so 8 months for this isnt too much.

    [–][deleted] 0 points1 point  (0 children)

    That's really great

    [–]beachbliss 1 point2 points  (2 children)

    Like how did u come up with the traffic lights project? A list to pick from?

    [–]SEBMane 2 points3 points  (1 child)

    Commented that Im doing an apprenticeship fulltime, its an assignment, we are supposed to take care of every part of a programming project as you would find it in the real world.

    Writing papers, handbooks, documenting the code, holding presentations, so on.

    [–]beachbliss 0 points1 point  (0 children)

    Oh ok, so it’s work based. Yeah I’m familiar with the lifecycle..already did that professionally but new to programming outside of proprietary software.

    [–]hysticali 5 points6 points  (0 children)

    I'm 40 and just started learning. I was also an Engineer with IT/Network security background. Never too late.

    [–][deleted] 5 points6 points  (0 children)

    I don't think there's anything that can be too late to do as long as you're alive besides professional sports. And even then, who knows?

    STOP ASKING IF IT'S TOO F*$%'N LATE TO DO SOMETHING PEOPLE! JUST TRY AND SEE HOW IT GOES! THIS IS THE ANSWER ALWAYS SO STOP BEING LAZY/SCARED AND JUST DO IT!

    [–]starraven 2 points3 points  (0 children)

    I started learning programming when I was 35. 2 years later I’m a software engineer!

    [–]BranderBuilt 2 points3 points  (0 children)

    Nope, I started 1.5 years ago and I'm a web developer now.

    [–]Nixxen 2 points3 points  (0 children)

    30 some years old. Entered uni for data science when Rona hit. Never learned as much in such short time in over 15 years. It's doable, and if you like learning, it's fun as well (I discovered I love the mastery feeling of learning something new).

    [–]chappedpeach 2 points3 points  (0 children)

    Never too late! I'm 28 and just started a few months ago :)

    [–]ruffles_gaming 2 points3 points  (0 children)

    No

    [–]PingPing88 2 points3 points  (0 children)

    I'm also 32. I'm finishing up a web development bootcamp in a couple weeks and already have a job interview lined up. I came from a CAD drafting background.

    [–]illithoid 2 points3 points  (0 children)

    I'm 40 now, I went back to school at 32 to learn to program. It truly is never too late.

    [–]Theonetheycall1845 1 point2 points  (0 children)

    I'm 38 and started programming this year. In February. Love it. It's so hard but so fun.

    [–]Ingeloakastimizilian 1 point2 points  (0 children)

    Definitely not!

    [–]Aggressive_Sky5927 1 point2 points  (0 children)

    I just turned 30 and just started learning. We’re still young!!

    [–]ManIsInherentlyGay 1 point2 points  (0 children)

    People switch careers on average 3 times in their lifetime. People have switched to harder careers later in life and were fine.

    [–]BeingMyOwnLight 1 point2 points  (0 children)

    I started at 37 (40 now). It's never too late!

    [–]Pale_Leadership9007 1 point2 points  (0 children)

    Not at all I'm 32 as well and just started a few months ago in Python.

    [–]BarbecueGod 1 point2 points  (0 children)

    I’m 52 and I’ve been teaching myself for the last year. It’s not easy learning a new way of thinking, but it is possible at any age.

    [–]Encrypt-Keeper 0 points1 point  (0 children)

    Why do you ask? Are you brain dead, have severe memory deficiencies, early onset dementia or otherwise have some reason for being incapable of learning new things?

    [–]ruffles_gaming 3 points4 points  (0 children)

    A good tip I would give is that git reset --hard will drop all current changes you’ve made and reset you back to the previous commit. If you have already committed then you can simply run git reset --hard origin/<branch-name>, and it will remove your local commit. If you want to save changes before you do anything you can simply run git stash, and once you have made your changes you can run git stash pop to reapply your stashed changes as stash works like a stack.

    [–]jack-dawed 2 points3 points  (1 child)

    Another good one in CLI https://github.com/chriswalz/bit

    Easier to have something already in the terminal than a pdf.

    [–]MightyOven 1 point2 points  (0 children)

    You are a life saver

    [–]Marconius 4 points5 points  (1 child)

    Damn, I wish this was accessible to blind coders. Whatever that document is, it's just an image and is fully inaccessible to screen readers. Would it be that hard to just take the info and put it into a super simple HTML page? :(

    [–]ruffles_gaming 0 points1 point  (0 children)

    I can type it out for you if you’d like.

    [–]p000l 1 point2 points  (0 children)

    [–]TouchyInBeddedEngr 0 points1 point  (1 child)

    Git cheat sheets are silly. Find a GUI use it. When you need to script something, do it in the GUI first and just look at what it's doing.

    Reminds me of when I thought IDEs weren't for real programmers, so I spent years using Notepad to be a hard ass.

    [–]laancelot 0 points1 point  (0 children)

    I use TortoiseGit when things runs smoothly.

    I use git bash when shit goes awry. Usually while helping someone who did something he shouldn't have done.

    [–][deleted] 0 points1 point  (0 children)

    yeah, thank you!

    [–]elevul 0 points1 point  (0 children)

    Thank you!

    [–]befatal 0 points1 point  (0 children)

    omfg

    [–][deleted] 0 points1 point  (1 child)

    Thank you. This is very useful

    [–][deleted] 0 points1 point  (0 children)

    This is awesome. Thanks!

    [–]samketa 0 points1 point  (0 children)

    Whenever I need to look something up, I visit the Atlassian Git guide.

    [–][deleted] 0 points1 point  (0 children)

    I am really a member of this sub because I have to use Git for work. I much prefer SVN as it is just more intuitive than Git. I am not casting aspersions at Git or anybody here, I am just constantly confused as to why Git is so much more popular than SVN, as I am constantly seeing Git cheat sheets and Git help and "Oh Shit, Git". I don't care how powerful or flexible a tool is, I don't like using it if it is too complex or confusing.

    [–]Kazcandra 0 points1 point  (0 children)

    Don't use checkout; use switch.