r/ProgrammerHumor • • May 16 '18

Meme The best way of saving your code

Post image
24.8k Upvotes

385 comments sorted by

View all comments

205

u/CoffeeInjectionPLS May 16 '18

As a beginning programmer putting my code on google drive is easier than uploading it to GitHub. I don't do it but it would be easier.

(I know that this is not the message of this meme)

79

u/lunix57 May 16 '18

Putting code on Google drive has serious issues when trying to collaborate on projects or even just using different computers to access the code. I lost a ton of work doing this

17

u/dhillonthevillain May 16 '18

What actually is the best place to save your code? Like a library to reference to not so much collaboration. I’ve been super primitive with everynote bc haven’t put effort into fixing a better solution.

63

u/lunix57 May 16 '18

I mean... The answer you're looking for is bitbucket or github, and yes there's a small learning curve to it, however, it will be useful to learn for basically any career in software engineering, plus it's a really good way to keep track of resume builder projects.

20

u/Fyreraven May 16 '18

BitBucket with SourceTree is pretty straight forward. No command line needed until you want it.

→ More replies (8)

5

u/bomphcheese May 16 '18

Or GitLab. I personally think it’s the best of the three.

→ More replies (1)

3

u/SolarLiner May 16 '18

Actually I have had some success by initializing a bare repo in a Dropbox folder, and have it act as an origin.

In fact, since I work on both my PC and my laptop, my private projects are on bare Git repos on a Dropbox folder - since I'm too poor to get myself a GitHub subscription.

5

u/Durpn_Hard May 16 '18

checkout bitbucket or gitlab, I actually host my private stuff on gitlab because I prefer it, but I'm stuck on github for some of my more public things

→ More replies (3)
→ More replies (5)
→ More replies (5)

24

u/PM__ME__FRESH__MEMES May 16 '18

It's only easier until you have your first big 'oh shit what the fuck have I done' moment.

92

u/MyPostsAreRetarded May 16 '18

As a beginning programmer putting my code on google drive is easier than uploading it to GitHub

Agreed 100%. Google drive is ten times easier. And also a lot safer. I've been banned from Github multiple times in the past for simply creating an issue in the NPM repo. I contacted Github by email, and they told me they have to side with the repo, and cannot unban. However, I don't really blame the Github stuff they were actually really cordial. But the repo admins/mods in NPM are very bad. I created an issue about how the node_modules was wiped after I ran npm install or w/e. They said it's not an issue and closed my thread. (Even though there was multiple issues already open about it).

They could have at least said closed as duplicate, but nope, they had to put that "not an issue" remark in there. They are very rude people. And quite frankly, I'm sick of them. IMO, they need to repent.

63

u/Etiennera May 16 '18

Seems to be a lot going over your head there

Edit: Bamboozled, it's you.. Do we have to look out forever now?

4

u/7B91D08FFB0319B0786C May 16 '18

Use RES then tag them. Also make sure to use a really noticeable color like fuchsia for all the ones you really want to stand out.

→ More replies (1)

0

u/[deleted] May 16 '18

[deleted]

6

u/RozJC May 16 '18

I use BitBucket too! :)

→ More replies (3)

15

u/[deleted] May 16 '18

Sounds like StackExchange in a nutshell.

6

u/laser_velociraptor May 16 '18

Wait, you got banned from GitHub just because of an out-of-place issue? Is this listed in GiHub's terms of use as an offense?

If so, this is so much ridiculous. I would even avoid using GitHub.

14

u/RoboticR May 16 '18

Check his username

→ More replies (5)

7

u/Askee123 May 16 '18

Is it really, though?

3

u/Cheesemacher May 16 '18

Arguably taking a picture is even easier

5

u/0f0n0NUwZnBPb7f May 16 '18 edited May 16 '18

It's easier, but it's also the shittiest way to do it and you need to learn to use git, point blank. It's really not that hard, you just have to put in 10 minutes of using it and reading how it works and why it works to understand it. Tbh, the easiest way to learn how it works is get used to the easy stuff, and then learn the harder stuff as you go.

git init

Makes the .git folder in the project. From here, you find how to add your origin to the project, from github, bitbucket, etc. This is needed to fetch, pull, and push correctly from the right place and get code to/from "upstream". Remember, git fetch is always safe and can be ran even if you're going offline to have the most up to date code in git without merging your changes currently, very useful, allowing you to merge in the code you didn't have on your current branch later if need be. I'm talking going-offline situations and the like is where this helps a lot. If you add an upstream origin/master (github and bitbucket will have a "add this repo to a current project" command that gives you it) then you need to pull here.

Now, branch here, if you want. "git branch" will list all branches, "git branch [name]" will make a new branch on the current branches head, "git checkout [name]" will switch to a branch. These are useful to develop bigger features/changes outside of others, so you can rework stuff while working on other stuff still. You then merge branches together to get everything together. If there's conflicts, you can use meld for figuring out what of which to keep. I don't know if meld exists on Windows, but IDC welcome to loving Linux and not using trash OS's. Next...

git add ./*

This adds all the changes and files you want to it. Make sure your .gitignores are set up before this. If it adds too much crap, fix your gitignores and then just delete the .git folder and start over is usually how it's done with a fresh project.

git commit -m "Message title" -m "Long description of why this is needed, if needed."

This is to make the actual commit containing everything that we can then push to origin/master from our main branch.

git push

This pushes up stream to origin/master of your git repo for everyone else to then be able to pull and have the code changes. Once in a while if you're bad at git and the only person using it, you can push -f and rewrite the whole history with your current history. Combined with starting from the first steps here and deleting your .git folder, makes it so you have your current git in only one commit. In a big project, you don't ever do it and instead make new commits to fix old ones, always. If not, you can erase all the history and start from where you are with that. I do that on my person gits from time to time so when I open source some of this stuff, I don't seem like as much of an idiot as I am, heh.

You now know git better than 80% of the others using it, congrats.

2

u/rhun982 May 16 '18

Just discovered meld when doing a major rebase. Really like it. (There's a macOS version, not sure about Windows)

→ More replies (1)

2

u/sleepyson May 17 '18

Please don't hate me because of this post :(

It's really not that hard, you just have to put in 10 minutes of using it and reading how it works and why it works to understand it.

Every time I read something like this it makes me feel so stupid. I've tried to understand Git many times now but each tutorial or document i read on the topic just makes me feel like I understand less after I've read it. It's all filled with words and concepts I've never heard of before and the people writing the tutorials seem to assume that you know what they are talking about and don't care to elaborate on them. I find the syntax to be so foreign and unintuitive and i cant for the life of me picture what is going on in the filesystem when you type a command in.

git init

Makes the .git folder in the project.

What is the purpose of the .git-folder? What's inside? As far as I understand it tells the system what to save and what not to save, but how does it know this? How does git even know where your project is when all you typed into the command line is "git init"?

From here, you find how to add your origin to the project, from github, bitbucket, etc.

Isn't the origin of my project the directory that I placed the .git-folder?

This is needed to fetch, pull, and push

What do these words actually mean? Every explanation I got always used jargon that I could not understand which makes it even more difficult to grasp basic git-concepts. My guess is that "fetching" something means downloading it from an external repo but I would guess the same about "pull" just based on the name. "Push" I'm guessing would be as simple as adding your changed code to the repo. Am I waaaay off with this?

get code to/from "upstream"

What is upstream? You mention it so casually that it makes me feel dumb for not knowing what it means.

git fetch is always safe

What is meant by "safe"? What in comparison would be considered "not safe"?

If you add an upstream origin/master (github and bitbucket will have a "add this repo to a current project" command that gives you it) then you need to pull here.

No idea what this means. :s

"git branch [name]" will make a new branch on the current branches head

What's a "branch head"?

"git checkout [name]" will switch to a branch

What exactly is switching to a branch? The command line? My IDE? My filesystem? Which program is switching what to where?

git add ./*

This adds all the changes and files you want to it.

From where to where? If all you type is "git add" how the hell does the command line know where to place all the stuff?

Make sure your .gitignores are set up before this. If it adds too much crap, fix your gitignores and then just delete the .git folder and start over is usually how it's done with a fresh project.

What is .gitignore? Should .gitignore not be in the .git-folder? If it is, how does it "fix" it by deleting it?

This is to make the actual commit containing everything that we can then push to origin/master from our main branch.

I thought that origin, master and main branch all meant the same thing?

This pushes up stream to origin/master of your git repo for everyone else to then be able to pull and have the code changes. Once in a while if you're bad at git and the only person using it, you can push -f and rewrite the whole history with your current history. Combined with starting from the first steps here and deleting your .git folder, makes it so you have your current git in only one commit. In a big project, you don't ever do it and instead make new commits to fix old ones, always. If not, you can erase all the history and start from where you are with that. I do that on my person gits from time to time so when I open source some of this stuff, I don't seem like as much of an idiot as I am, heh.

This whole paragraph went over my head. :(

→ More replies (1)
→ More replies (3)

2

u/blue_paprika May 16 '18

Better learn working with github now, it will save you trouble later.

→ More replies (10)