Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API

From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "git"
-
Me: *just playing around with Git on my terminal*
Friend: "Man, you're such a geek, typing your git command on the terminal.. I myself can't use git without the GUI at all"
Me: *stares at him in silence*
Me: "Wait... THERE 'S A GUI FOR THAT?"
*true story when I was in college*45 -
git blame
git fired
git depression
git divorce
git homeless
git commit
git job
git house
git wife --better
exit11 -
Why is the "leave building"command now working?!?!?! Are you sure it's a Git command?? .... Oh shit.15
-
Sometimes I name my project "suicide" so that when I do a git commit I could say that I committed suicide.4
-
Today a Coworker got a little piece of paper acknowledging that he was a Git master, two hours later he fucked up all the branches.6
-
You know you messed Git hard when your commit graph started to look like November Rain on Guitar Hero.4
-
Crazy how git got its name:
The name "git" was given by Linus Torvalds when he wrote the very first version. He described the tool as "the stupid content tracker" and the name as (depending on your mood):
- random three-letter combination that is pronounceable, and not actually used by any common UNIX command. The fact that it is a mispronunciation of "get" may or may not be relevant.
- stupid. contemptible and despicable. simple. Take your pick from the dictionary of slang.
- "global information tracker": you're in a good mood, and it actually works for you. Angels sing, and a light suddenly fills the room.
- "goddamn idiotic truckload of sh*t": when it breaks
~ from github git1 -
I forced my friends to use git(hub) as vcs because their project was in a usb-to-usb state, which was unacceptable for me. So I offered them my help and uploaded it (with a little bit of a forced consent) to github, to end this misery. Of course I helped them the basics of git. Now they automatically use git(hub) as vcs and to share their code.
I feel proud for this :)11 -
Best Git commit msg I ever saw was nothing more than: "please work"
...found after a junior dev left our company and we were reviewing things4 -
With the other members of the team refusing to learn git and making changes directly to the staging server i get to write the commit messages for everyone.
Log:
UPDATE: *informative details *
UPDATE: mark made some changes
UPDATE: colin made the same changes as mark but different
UPDATE: andrew undid all colins updates to change one link and I had to add them back in, thank gawd I commit the night before
BUGFIX: andrew keeps changing the database host to localhost and uploading it without changing it back
UPDATE: we all hate andrew15 -
Fell like I can finally vent this now I've calmed down.
Me: You've fucked the tree again
Junior: No I haven't
Me: It says there "Fixing merge conflicts"
Junior: Well it wasn't me I wouldn't have done a merge
Me: It has your name next to it...
Junior: Well that commit wasn't there a second ago
Me: it's dated for Friday...
Junior: Well if you hadn't committed to master and blah blah blah
Me: We'll if you knew know to use git we wouldn't have this problem.12 -
Sorry John Doe, you're application for this job has been rejected. As we specified for this job you need to know about GitHub. In your CV you stated that you are an expert in git but our job requires the knowledge of hub as well. Good luck next time11
-
A coworker blamed me that our git server is rejecting his changes. Turns out his commits are 200MB large each, including binaries of all newly added libraries. And I was all like:8
-
Had a fun little conversation with a potential employer...
Him: We use git for version control. To work with our team you'll be expected to do the same and be proficient at it.
Me: Not a problem. I am well versed with all things git! May I ask, what does your work flow look like?
Him: All of our source lives in a single repo and everyone commits straight to master.
Me: 😐...
Him: Conflicts will not be tolerated.6 -
Everyone in my company prefers solving git issues rather than `rm -rf` & `git clone`
Feels like I'm working with a team of geniuses. 😂13 -
I just started using git. it is unbelievably useful. What an idiot I was that I didn't start using it earlier. I LOVE GIT!3
-
> git commit -m 'fixing what I broke earlier'
> git pish
> git: 'pish' is not a git command. See 'git --help'.
Did you mean this?
push
> you know I meant push, why can't you leave me alone and just do it13 -
Every time I mess up my git branch I usually find that its pretty futile to fix it with fancy commands like 'git reset', 'git prune', 'git rebase', etc. I usually find it easier to just start over from scratch.
They should really add a command for that
'git fuck-it-start-over'9 -
Don't want to break your commit streak on Github.
So you change one line and :-
git add .
git commit -m "Minor Tweak"
git push
VOILA ! the box is green for today . *Evil Smile*5 -
Sometimes I forget that not all Terminal commands begin with "git."
git ls
git less fileName.ext
git cd ..3 -
got commit
got add
got pull
got push
...
Typos.. every.. Damn.. time.. so I assigned an alias for got = git9 -
I forced myself to use git on my latest projects. And the more I use it, the more I love it. I can relate to all the git-love here on devRant.21
-
git commit -m "last"
git commit -m "last1"
git commit -m "real last"
git commit -m "real last 1"
git commit -m "real real last"8 -
Code with syntax coloring fascinates my young nephew, so after I commit and push, I let him do his thing then later I do a
git reset HEAD --hard3 -
One day Linus Torvalds will make a statement about git like: "Why is everybody using this? It was just a joke!"2
-
To all those people that have Git alliases like:
"gc" = "git clone" or "ga" = "git add"
What do you do with all that extra saved time?19 -
I forgot to git fetch, so I spent quite a while doing exactly WHAT MY TEAMMATE HAD DONE JUST HOURS AGO3
-
-> everyone at the company uses git
-> asked to change some stuff
-> boss says "don't remove the old code, just comment it in case we need it in the future"
-> ...
-> ???3 -
Wanna gently annoy your coworker? Every time they send you an idea about something code related, just respond with:
"git checkout shitty_ideas"3 -
Remember kids, clear out any login credentials before doing git commit and git push!
/smacks himself6 -
when the moon hits your eye
like a big pizza pie,
that's amore
when a file you don't need
exceeds 50mb,
.gitignore -
Me: How can I delete pushed commits from origin?
Colleague: Just do git reset --hard and then git push -f
Me: But this is dangerous
Colleague: Wait, I'll do it myself
Colleague: Done
Me: But nothing happened
Colleague: Fuck. I just removed all changes on my own branch2 -
I'm going to teach web dev at a coding school in a few months. In the teaching plan, students have to learn git. But we are told explicitly to only teach using github desktop and not the command line because it puts students off.
I'm not sure how to feel about this12 -
$ git add .
$ git commit -m "This HAS to be online soon"
$ git push
*merge conflict*
*did not look at difference*
*using mine*
$ git commit -m "resolv merge conflict"
$ git push
$ ssh root@x.x.x.x
# git pull
# cd /path/to/webapp
# npm run production3 -
I have previously worked with a company where they were copying project codes through a USB and making local backups of the whole project with dates and not using git.4
-
So I started to read the book „Mastering Git“ by Jakub Narębski (*) and I am so impressed of how much more git is than just commit/push/pull 😳
(*) https://packtpub.com/application-de...1 -
One of my teachers pronounces the 'g' in 'git' like the 'j' in 'jet' and it confuses me each time he says it5
-
If git was written in english or in ancient greek it made no difference. It's everything counter-intuitive and you have just to learn commands by heart and google the errors. Because nothing makes sense, even if you know how it works and you used it for years7
-
Someone is whining about how hard Git is in an article they wrote. They work for GitHub. The article was posted to HN.
Yes, let's make things so easy a literal baby can do it.16 -
I think the reason why git beginners have a hard time with it is because the api is a bit untuitive.
For example: if you want to "unstage" staged changes, you run git reset, and if you want to "delete" those changes from your working copy, you git checkout those files.
But then, you find out that you can do all of that if you git add . and git reset --hard.
So you're like "huh..."
And then you discover that if you end the resethard with a branch name/commit id then you also make current branch point to the commit or that branch/commit (respectively).
So you're like "huh..."
And also if you add a commit id or branch name to git checkout, you change the current branch to specified/enter detached state with HEAD pointing to that commit (respectively).
Oh and you don't use git branch to create branches, you use git checkout -b because it's a lot shorter.
So here's a rundown: git reset mutates things related to files, but also mutates things related to branches.
git checkout also mutates things related to files and mutates things related to branches too (in a diff way). Also, creates new branches.
I don't think this is intuitive. We users use the same commands for different purposes with just a different flag.
Commands shouldn't mutate different types of things. But don't composite commands (as in, "smart" commands that mutate different things) shoudln't be a flag in an existing command, it should be a single new command of its own.
Maybe if I reread the internals of git now, I'll be able to disgest the dozens of technical terms they throw at you (they are many). And in my mind, the api will cognitively fit to the explanations.
Here's another one that feels weird too.
If you want to make your changes start on top of someone else's commit, you do git rebase.
But git rebase -i can be used for that, and also to delete, modify changes or message of, reorder or combine previous commits of the current branch.
Maybe the reason why several things we do overlap with the same commands is because they internally do similar things, and while not separating those commands might make it less intuitive, it makes them more sensible? i dunno...
disclaimer: I'm not setting this opinion in stone though, and am aware that git was created by one of the most infuential programmers.7 -
I just noticed visualizing git is like a timeline with alternate realities and a lot of time travel. The main branch is the main timeline and the branches are like fixes from the past to try and make the future better they merge when the future is fixed otherwise if someone or something fucked up time traveling it becomes the main timeline.
-
Sometimes I think that git is like a drug. After getting past the initial learning curve, you use it in every single one of your projects. Sometimes I wonder how have I ever survived without git before.3
-
Accidentally rm -rf a git repo, one of the branch still not pushed to remote yet. I managed to use file recovery software to recover the .git folder, any idea what to do next?28
-
Honestly, without git version control I wouldn't know how I could manage my project properly. Git is awesome in so many aspects <34
-
Fuck me and fuck merges and fuck conflicts!!!
I still love you Git but sometimes you are a harsh mistress.6 -
Me: we should take this project a little more serious, follow the coding standards and please let us use git!
Pal: Oh sure.
//made a new repo and the first commit, sent the link and prepared everything (Granted access etc.)
//2 weeks later
Me: What's up, I already got quite some commits and you haven't pushed anything so far.
Pal: Pushed? what do you mean?
Me: I'm the talking about the git repo, I'm the only one contributing.
Pal: Oh yeah git, I installed it but I have no idea how that stuff works. I opened Git gui but i don't know what I'm supposed to do. I got everything in the Dropbox tho.
Me: ... ... ... FUUUUUUUUU WHAT THE FUCK MATE ARE YOU SHITTING ME, THE HELL DO WE HAVE GOOGLE FOR AND WHY DIDNT YOU ASK, LIKE WTF SERIOUSLY I EXPLICITLY TOLD YOU TO USE GIT.
😣2 -
Git: the occasionally frustrating, dangerous, and infuriating VCS you can't believe you were living without.
-
my company uses svn for source control. just found out the guy in charge of the repo actually uses git and just has all developers use svn because "there's less of a learning curve". WHY?!?! Git is so much better!4
-
I know it's not recommended to write git commit messages in past tense, but it makes more sense to me to use it. Maybe I'll change as I grow and learn more in the programmer world, but as for now, I'm going to be a rebel and ignore convention😎5
-
One day i started to code.
One day i was told you will not code without git.
Many days i lost code on git because i was ignorant.
Today i reset the act of commiting without losing all my shit.
Git reset --soft HEAD^
I didnt event sweat it ;)
Today i feel like half a boss!!! -
Dont commit before you see this. Here's Adrianna, she thinks she founded GIT.
https://forbes.com/video/...3 -
Every other day, Git is the best version control ever. Today, got damn it Git, why can't it just work7
-
*spends 2 hours actually coding and working on the project*
*remembers hasn't made any commit*
Welp, guess it's time to do the git shit. -
I love git stash.
It's helps a lot for doing refactors to me. I guess it's not the most complex workflow, but it wasn't obvious to me when I started with git. Let me explain.
Refactors. As you start writing the first lines of a refactor, you start to notice something: you're changing too many things, your next commit is going to be huge.
That tends to be the very nature of refactors, they usually affect different parts of code.
So, there you are, with a shitload changes, and you figure "hey, I have a better idea, let me first do a smaller cohesive commit (let's call it subcommit) that changes a smaller specific thing, and then I'll continue with the upper parts of the refactor".
Good idea, but you have a shitload of changes nearly touching every file in your working copy, what do you do with these changes? You git stash them.
Let's say you stash and try to do that smaller "subcommit". What sometimes happens to me at this point is that I notice that I could do an even smaller change inside this current "subcommit". So I do the same thing, I git stash and I work on that even smaller thing.
At some point I end up `git stash pop`ing up all these levels. And it it shows that git stash is powerful for this.
* You never lose a single bit of work you did.
* Every commit is clean.
* After every commit you can run tests (automated or manual) to see shit is still working.
* If you don't like some changes that you had git stashed, you can just erase them with git reset --hard.
* If a change overlaps between a stash you're applying and the last "subcommit", then
if they differ, git shows conflicts on the files,
if they are identical, nothing happens.
with this workflow things just flow and you don't need to wipe out all your changes when doing simpler things,
and you don't need to go around creating new branches with temp commits (which results in bloated temp commits and the work of switching branches).
After you finish the refactor, you can decide to squash things with git rebase.
(Note: I don't use git stash pop, because it annoys the fuck out of me when I pop and you I get conflicts, I rather apply and drop)4 -
Something to cheer you up mid-week:
> alias yolo='git commit -am "DEAL WITH IT" && git push -f origin master' -
Git on VS doesn't want to ignore the files I've added in the .gitignore.
Still no shell for command line.
Well, looks like my changes will be filled with DLL files.12 -
Cleaning up after yourself if so damn important. Even your git repos:
# always be pruning
git fetch -p
# delete your merged branches
git branch --merged | grep -v master | xargs -n 1 git branch -d
# purge remote branches that are merged
git branch -r --merged | grep -v master | sed 's/origin\///' | xargs -n 1 git push --delete origin -
An amazing git story: A month ago coworkers did research and started with merge requests. Their workflow is as follows: A Feature is developed in a branch, then a merge request is opened. After a very short review it will be closed (rejected) and merged without request. (wtf!) After that the develop branch will be tested later, in case of bugs, a new branch per feature is opened.3
-
Wondering how many people use git cmd and how many use different git clients.
I regularly use git cmd. I made a transition from clients a while back because I wanted to learn more about how it actually works and it works just fine for me, except when I have to google something I don't remember (like how to revert local commit)
Git clients will for sure do abstraction which can be both good and bad, but I'm wondering if there are any definitive pros for clients.12 -
One of my *co-workers* (intern turned full-time) had his user (the USER) initialised as a git repo. I've officially seen everything.3
-
Using git without a GUI is like biking blind-folded. Sure you can do it but it's way easier if you see what's going on.28
-
People who delete a repo and clone again instead of a hard reset because 'they can't undo the changes they made" are the kind of people who shouldn't be using git in the first place.4
-
How well do you speak git? Name all commands you know how to use 😄:
init, add, commit, remote, cherrypick, push, rm, rebase, reset, submodule.
Did I miss something?18 -
The first 30 minutes of a working day often consist of me saying, "who broke this then?" Then a liberal use of git blame.
-
Our git subtree completely stop working somehow. No one can get latest.
Now we are playing wood sword and pretend nothing happened. -
So recently i started using sublime merge. Found the ui kinda useful to review and stage files. Today i was double checking my staged files in smerge and bam! staged files worth an hour disappear! I am pretty sure i didnt click anything. It has to be sublime merge... right?? i could see an undo reset option in menu which didnt work.
Going back to good ol git cli. fuck git ui clients5 -
Hey DevRant, this is my first time working collaboratively on a project with Git and I'd like to know what's the best strategy to adopt.
Is it that every member has their own branch on origin that they push to, then we meet and plan out merges when it's time to release? Or does everyone just push to master, but stash or commit their local changes before they pull?
It's a Greenfield project, with just a bare repository on the central server. It's an MVC app where I've decided to do the View & Controller portions and the other person is doing Models and data services layers.15 -
git stash pop'd on wrong branch, hadn't realized it until after a bunch more work. Then continued screwing things up and unit tests are failing.
This is not a good coding day. -
One of my colleague uses git prune to make a local branch track origin. I told him the way to do this (git branch -b newbranch, git branch -u origin/whatever). He says why do it in two commands when you can do it in one. I asked him what do you think git prune actually does? He says, "Who cares?". It pains me deeply.
-
Git should rename their commands to past tense verbs, so it can be "git merged!" (get merged), etc.4
-
What Git client are you using? Also, what's a freemium Git client that is cheap? Sorry I'm not a fan of monthly subscriptions (hi gitkraken and Git tower) Thanks! 😎25
-
Just came across a commit in a production application's Git repo titled "Stupid whitespace".
Glad to see we're not all robots yet :)2 -
This is one of those moments when I just wanna say FUCK this git crap, clone this, pull that, CI this, build that, deploy this shit there, wait for 10 minutes to receive objects...oops, invalid key, start over... oops it failed for some other shit reason, start from scratch.....x100 or whatever number of servers you're deploying to... which obviously NEVER behave the same despite being built from the same fucking image?!! whoever the fuck came up with this kind of workflow didn't have to go through the pain of working with 50 gig repos.
And fuck your volumes too, 27Mbps IO? Really? in 2020?
StoRe YouR AssEtS in S3. FUCK THAT NOISE. The fuck if I'm going to have to deal with 100 alerts for various errors and failures each minute just because and I'll be double fucked if I will give up working with shit on a local filesystem rather than some 3rd party service. WTF an API just to store my shit? Whatever the fuck happened with cp -r and mv -f and ls -la, fucking S3 huh? We're so cool bcos w3 storez ur filez in a DaTaBAsE now. FUCK YOU. GO SUCK MY POWER CABLES.8 -
Goodjob Self, you fucked up your Git local repo.
```
[ git checkout master || git stash ]
fatal: git-write-tree: error building trees
Cannot save the current index state
```3 -
I feel like Git could have come up with a better name than "force push".
It just doesn't seem right... If your codebase doesn't want your commitment, you really shouldn't force yourself on them. No means no god dammit!4 -
Git tip: Before doing "git clean -fd" always think twice and backup the whole folder manually before doing that. Take it from me.
Also be careful with, "git pull" 😩13 -
Pretty difficult to control bad rebasing so... merge for the win!!! #Git #developerproblems who is with me??
-
What would you prefer ? Mercurial or Git? why should i use mercurial and why not git? i am confused.13
-
When your terminal is so sexy ,you write a blog on Medium just to show it off. xD
BTW..That's my first blog ,show some love:-
https://medium.com/@divyanshtripath...6 -
This is git.
You code whatever, add the files, commit and push.
Just keep doing at repeatedly.
Until your push is rejected, in which case you delete the local folder and re-clone the whole thing.
#howOneLearnsGit -
temp commits are generally more useful than git stash.
instead of stashing, do a commit with a message like "THIS IS NOT A COMMIT, DON'T INCLUDE THIS". with some discipline you can then go back to your branch, `git reset --soft HEAD~1` and voila, it's similar to a `git stash pop`.
but it's better because you can do this in multiple branches at the same time and there's no fear of accidentally dropping some stashed commit.5 -
The moment when you forgot to git commit and push, and you decided to continue to work on new features and you could not roll back to the previous build...3
-
Just lost 2 days of works, don't ask me why.
git is good, but someone doesn't know how to use it, I will never tell you that's me.2 -
When you run some dangerous git commands, then realise you're in the wrong repo... oops
Luckily I didn't lose anything -
when my Git Bash got "died waiting for dll loading" issue, and the only solution is to shutdown cygserver2
-
When your changes keep being reverted and you finally discover the 'experienced' contractor has been using rebase and 'take mine' in git merges.1
-
My TPM just asked me to upload the files I changed on the server, I asked if they don't use git (today is my third day in this company), he said no. And today is also my last day, because I resign at the end of the day.1
-
if you're new to git, becareful not to do something like git reset --hard
it works similar to
git checkout --
rm -rf.
and deletes your files that haven't been checked in3 -
The dev behind me just send some code changes to another dev because those two dont want (or are just too stupid) to merge their code with git...2
-
Learned git, decided, imma use this while I make a little game in Java, couple days later, I find out that net beans has git INSIDE of it... :/ ....3
-
My PM (who's not a coder) is trying Git
I could see that by the fortunatly inoffensive merges that appeared randomly.
That's still funny.
Now to teach him not to "Sync" everytime he wanna "Pull". -
Fire at work place.
Normal People: Immediately run from the gate.
Programmer: Git add, Git commit, Git Push, realize fire on the gate, jump from the window.1 -
Going through my git commits and wondering why I would just commit every file under the same commit. More often than not they had nothing to do with eachother 😐2
-
!rant
In case anyone else finds this useful - Git 2.22 gets a --no-overlay flag, allowing you to switch directories between branches at will *without* having to clean up any newly created files in the process.
Long overdue IMHO. -
When you're a comp Sci student helping fix one of your peers' projects and you have to spend 10 minutes hitting ctrl z because they don't know what git is.1
-
I Love git. After a year, I still can't decide how to break my commits up. Should I create a new commit with every level me of code, or every function or feature meaning (a few functions). What are your ideas?33
-
Update local removed git branches
You can update the removed branches on your local machine by
git fetch --prune --all3 -
Use
git branch --merged
to get, you guessed it, all the branches you have merged.
Use
git branch -d <branch-name>
To delete a branch if it has been merged (use -D for forced)
And Use,
git branch --merged | egrep - v "(^\*|master|dev)" | xargs git branch - d
To delete all the branches that you have merged (but not anything with master/dev in their names)
Sorry for the formatting, I don't know how coder formatting works on DR..4 -
https://i.imgflip.com/2i02zy.jpg
git branch -r
origin/204/match-dsteem-on-sign-transaction
origin/305-support-hive-legacy-api
origin/307-call-async
origin/72-http-socket-support
origin/HEAD -> origin/dev
origin/appbase-http
origin/chore/fix-ws
origin/default-server
but
git push --follow-tags https://github.com/lopudesigns/... --set-upstream origin dev
fatal: refs/remotes/origin/HEAD cannot be resolved to branch.
wut -
Question about managing git branches.
For releases, we branch develop (the main branch) into a release.version branch in which we bump the version and do any last minute bug fixes for issues found in testing.
After the release we need it back into the main branch as well as master.
But also we keep the branch as well in case we need it such as for a hotfix release.
Is keeping it right though?
General issue on my team I feel is nobody deletes their feature branches after they are done and merged into the main branch. I think there is a feature in most Repos where it can auto delete these branches when a PR is merged.
And well branches themselves (at least the HEAD) are sort of just bookmarks. All commits can be accessed by their hash and basically is a full snapshot of all the commits that upto that point that it was based off of?
So you could just tag the last commit in the release branch with release.version and delete the branch itself? And that I think is the correct, normal way?
Not sure how to explain this to my boss or team as they aren't big on technical details...9 -
Was exhausted after coding for a full day, was going to commit all the work at the end of the day. Then my brain snapped: wanted to hit `git add .`, hit `git checkout .` instead.
Lesson learned (the hard way): "commit fast, and commit often"1 -
I thought the ReadMe file on git was for how to use someone's source code. why I find most of them empty!! 👊 😉 others jst have -----###2
-
Need some help!
How can I create a git release with only distribution files?
Let's say I have a Sass project and it compiles to a single CSS file. I want to provide just the CSS file in download as release and exclude all other source files. How can I do that and how should this be automated?
Thanks5 -
I messed up something with my git and now it opens git log everytime in vim, which i don't want. Is there any way I can just print it using less or cat and not open in vim?1
-
Gotta love git. Every time I look for something I don't know I learn about some new fun command like
git update-index --really-refresh
And yes, there's a regular refresh command as well :)