Tfw I just don't get it

>tfw I just don't get it

Other urls found in this thread:

blahblah.url/file.git
youtube.com/watch?v=1ffBJ4sVUb4
ohshitgit.com/
pluralsight.com/courses/how-git-works
github.com/drv53b6/git_if
youtube.com/watch?v=bZe5J8SVCYQ
try.github.io
learngitbranching.js.org
snapper.io/faq.html
twitter.com/SFWRedditVideos

stop trying to understand it and just use it

i dont git it either

Me neither, can any of you explain it or post an infographic?

90% of my class clones the required repository for the course every time there's an update, they can't checkout/fetch/pull/etc.

I just started using it.

The model is pretty simple, and that's what makes the client so complicated.

A repository is a directed acyclic graph. At any given moment, your HEAD is at some node in the graph, so you have basically one path back to the first commit. All operations like merge and branch are just ways of managing where to branch of the graph and how to put it back in.

Just keep using it. If you find something you want to do but dont know how, find the obscure invocation on SO and if it solves your problem, spend a second reinforcing your mental model and why it worked in the first place.

git clone blahblah.url/file.git

>> work on the code a lil bit, edit some stuff

git add -A && git commit -m "some stuff"

git pull

git push

Handy commands I use a bunch:
Oh noes, I need to hotfix but dont want to lose my work!
> git stash

This blows, I want to nuke my work and start over from latest commit
> git reset --HARD

Oops, shouldnt have committed that
> git reset HEAD\^

Oops, shouldnt have pushed that. Do the above then
> git push --force

> Not checking status before committing
> Not using git commit -am "commit message"

You're probably trying to start with GitHub or some other online repo right away. Perfect storm for confusion. Stop. Learn how to use git with a local repo. All you need to know for basic version control:

git add (add modified files to staging area)
git commit (commit staged changes)

Then learn about branches, that's another command or two. Finally, figure out how to work with an online repo...all you really need here is "git clone", "git pull" and "git push".

youtube.com/watch?v=1ffBJ4sVUb4

Best git howto ever.

ohshitgit.com/

Just use Github Desktop like any sane person, that's what taught me how to actually use Git

i use it, but don't really get it.
just hope for the best most times.

git revert to save history

Jesus fucking christ guys, git is not that hard...

git good at it

underrated

What I like about git is when I'm too lazy to google commands I can just push to a local folder or something and yay I have a "branch" that I can push to, pull from, merge with, whatever.

The commands can be a bit dense, but it's extremely modular and works in a very human-readable way. Hell, merging just creates comments in your code and you can just open up a text editor and fix them manually if you were so inclined.

I think the whole point of git is that you don't need to keep full copies of different versions of a program.

git is awesome. Stop being a brainlet.

you should not always use -am

Try using a GUI client. I can recommend GitExtensions.

git add .
git commit -m "the other guy is right you should just use -am"

Git's not that hard, SVN on the other hand...

Use git as much as possible, even for the smallest of projects. Learn how to rebase early, because that's the most important concept for contributing to large projects (rebasing makes it easier for people to integrate your code).
Don't worry about having "perfect" commits if you're just working alone on a new project. Remember you can always blow away the repo when you have something stable and do git init again before you take it public.

I just save code files into separate backup folders

never could get used o fancy shit

Lol

I found git to be really annoying to use from the command line. I tend to use git versions that are either integrated with my desktop for IDE. Much better.

*or IDE

sudo git gud senpai

gitgud.io

I just started using git about 4 months ago for my new job. Im only now starting to understand it and I'm still fuck up all the time.

Goodluck!

Can you stash multiple repos? if so how would stash pop work

>he is GUI cuck

jesus chrits

You just have your own local repository when you clone the remote.

You have to synchronize your repo with remote, but you don't accidentally lose work from a bad diff, have disgusting branch merge issues, etc...


Additionally, if you don't understand it after honestly trying to learn it, then maybe you shouldn't be writing software.

git gets easier once you understand that branches are just homeomorphic endofunctors mapping submanifolds of a hilbert space

Git knows what all the repository changes are at all times. It know this because it knows what they aren't. By subtracting what they are from what they aren't, or what they aren't from what they are, whichever is greater, it obtains a difference, or 'deviation'. The Git subsystem uses deviations to generate patches to change the a repository from what it is to what it isn't, and arriving at a state which it wasn't, it now is. Consequently, the state that it is, is now the state that it wasn't. And it follows that the state that it was, it now the state that it isn't.

In the event that the state the repository is in is not the state that it wasn't, the repository has acquired a 'variation'. A variation being the difference between the current state of the repository, and what it wasn't. If variation is considered to be a significant factor, it too can be corrected by Git, however it must have access to the full commit history.

The standard Git repository scenario works as follows: Because a variation has modified some of the commits to the repository, it is not sure just what the state of the code is. However it is sure what it isn't, within reason. And it knows what the state was. It now subtracts what the repository should be from what it wasn't or vice-versa. And by differentiating this from the algebraic sum of what it shouldn't be, and what it was, it is able to obtain the deviation and it's variation.

Treat it as a filesystem

t. brainlet

I've never really tried to use it before, probably should someday.

This is a really good course for understanding how Git works under the hood:
pluralsight.com/courses/how-git-works
It is a very simple course and uses cooking recipes as the data

seriously, if you dont understand the concepts of how git keeps track of data by using lists of hashes then it will never make sense to you

git is a tool created specifically for the massive number of users and commits to the Linux kernel. The fact that it's become the defacto code repository system of modern "developers" is a testament to the memery, shallowness, and cargo-cult nature of the industry.

So what should developers be using for version control instead of git? SVN?

>I dont understand it so I will call it a meme, bloated,
typical brainlet response

Don't forget git clone --branch [tag/branch] --depth 1 [repo] if you want to compile a latest release or branch without downloading the entire repo.

it's not always acyclic because whenever you merge you create a cycle.

not a directed cycle

all the old farts at work do this and it pisses me the fuck off, especially when they bitch and moan about learning something new, only to later admit there's absolutely no hope for recovering their code if they die/their hard drive does.

It took me some time to understand when to use stash and shit but now that I have learned that, git is amazing

Similar experience to vim really

You don't need git to have a backup

I might need somebody to talk to
my bar for running git init && git add . in a directory is extremely low

I know. My point is that they have no means for sharing their code, since it's all tucked away on some removeable drive somewhere that only they know about.

github.com/drv53b6/git_if

Thats some dedicated shitposting

Sup Forums should have a public git repo. No idea behind it, just a git repo for shit.

it is accurate

The problem is picking an administrator who wouldn't shit it up but also wouldn't be >NO FUN ALLOWED

...

You have a point.

youtube.com/watch?v=bZe5J8SVCYQ
Oh god that takes me back

it gets complicated with you have a shit ton of other people working on the same repo

>Oops, shouldnt have pushed that. Do the above then
>> git push --force
Don't be a dick and do that to a shared repository. Use git revert instead.

>pull
>fix merge issues
>push
brainlet.jpg

The arch wiki has a good article on git

Staging and unstaging, clone ,pull,push, commit are basically all you need to actually use it. Branching and merging once you get that down. Interactive rebase and learning to use log after. Using it is the easy part. Learning a good workflow and the more esoteric parts is rough.

Wtf

How can this Sup Forums post be a better git tutorial than 99% of Pajeet spam tutorials?

lol, just:
man git

Also:
try.github.io

...

use revert, not reset. reset deletes history, revert undoes the changes but saves the history (you can revert reverts but yo ucan't reset resets)

Just use a gui client, I use sourcetree at work.

It's just like any other version control system, except git is special in that it's not centralized. Every person has a copy of the repository.

The changes (only changes) to your code/text are stored in your hard disk, and have an ID (x15dj52d etc.. or whatever), this thing is called a commit, it's basically just a pointer. A branch has a bunch of commits.

fuck off reddit

>what are forks
wtf I hate using my brain now

This, and also learngitbranching.js.org

>tfw listened to this like 10 times over the past few years and finally it all makes sense

-am will not commit a new file

>wipe git commits every few months
>didn't test latest revision
>project is now broken and I have 0 commits to revert back to
>been trying to fix it for a week

just use git flow and don't be an idiot

why would you wipe git commits?

I leaked a password on github once now I'm really paranoid about it

figured it out, a folder was mistyped

...

>the virgin pull
>the chad clone

>working on large project on git
>finally finished now just need to push to repo
>do git clean to remove excess test files
>realize I didnt have project tracked by git
>entire project gets wiped
>can't git revert because the files weren't tracked in the first place

I'm not a programmer but I'm using git to write my PHD thesis in Latex

It's really nice to have a section solid enough so it is ready to commit and push

A lot of features I will never use, but what I can use makes life a lot easier

They should have an "academic git" that simplifies a lot this stuff for normies, group research projects and a lot stuff between students/professor would be made much easier

Git is brilliant but nobody is smart enough to use it.

I never got the difference between git pull and git fetch? What each is supposed to do?

I think pull is just fetch + merge

Seriously? This is software development 101 stuff. Use google and learn it..

Do they actually teach git at university now?

In my time we only had CVS.

Correct.

We use it for everything at work, except legacy stuff that still uses shitty Perforce.

>Sup Forums is actually helping OP
god bless you Sup Forums`

>nearly 2018
>on Sup Forums
>no backups
FUCK YOU. WHY ARE YOU SO FUCKING RETARDED?

snapper.io/faq.html + some backup solution of your choice. It takes only a few minutes. Do it NOW.

WTF is that accent?

>no pushes in between start and finish of a "large project"
Dude, you're gitting wrong. Use branches

I did some work on ss13 vgstation branch that had me learn more about git than i will ever need to know.
In the beginning i was merging like a retard instead of rebasing, it was horrible. Can even squash commits to hide shame and not get memed on.
Point is, collaborate on pointless shit for practice.