[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: wtf-git-check-metadata.jpg (129 KB, 1472x871)
129 KB
129 KB JPG
>Everyone at work is using Git branches
>I copy/paste files from git directory like retard
>I am able to use only GitHub Desktop
>I am fraud
>Try to learn GIT on some random website
>"Introduction" Level 1
>Instruction: type git commit 2 times
>I fucking broke it... how ?
>>
>>107802497
If only there was a way to interact with computers simply by using natural language.
>>
>>107802497
DID YOU REDEEM IT SIR?
>>
just let ai agent do it lol
>>
git pull
git add [file]
git commit
git push

how do you fuck this up?
>>
>>107802497
it's called RTFM
https://git-scm.com/book/en/v2
>>
>>107802497
N
>>
I don't understand what checkout does. How is this any different from git branch?

Non tech fag I just use git for my personal projects
>>
>>107802573
checkout changes the working directory to match whatever's in a specific commit, not just the commit pointed to by a branch name.
>>
>>107802573
git branch creates the branch
git checkout -b creates the branch and switches to it
git checkout switches to an existing branch

honestly git checkout -b is usually what you want, i never use git branch
>>
>>107802497
Git was made by the same loser that made Linux and it's just about as user friendly. Anon here's my advice:
1. Learn how git works: all you need to know is that a commit is a snapshot of all your files. Everything else: all the bad design and stupid commands and knowing how to get out of trouble flows from there.
2. Don't use git command line. Like all command line tools it's a waste of your time. You can use git-gui or better yet use a Jetbrains IDE and let it be your git interface.
3. Don't waste your time organizing commit history: nobody reads it and people who say they do are lying. All these "learn git" games do is walk through convoluted ways to rearrange commits which is completely useless. All you ever need to do is:
- create a branch
- get the code on that branch to be what you want it to be

When you ran
> git checkout C1
git did a retarded thing and detatched you from the `main` branch. So when you ran
> git commit
you created a new commit, but the `main` branch didn't update to point to the new commit. That's what
> detatched HEAD state
was trying to say.
What you could have done, after creating C3, is run
> git branch -f main
to point the main branch at C3
> git checkout main
to reattach `HEAD` to `main`.
Or just don't check out a commit to begin with.
But the real answer is to just not use the command line because it's a waste of your time.
>>
I "learn" git GUI at work
I know how to: add file before commit, commit, push, pull, reset to some history, switch
after few months I learned to make branch
>>
>>107802497
magit



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.