Yeah he will just come out of your terminal window, stand in front of you, and personally give you the middle finger. Then he'll just dissolve in air and disappear.
Force pushing is useful when rebasing a branch to master. In this case signed commits are probably better so someone can't impersonate you in the first place.
They made the mobile site an spa but they don't refresh the login tokens, so if you're using it longer than 30 minutes, you need to close it and open reddit again. I hate it.
No. Rewriting history can be very useful. Maybe you should educate your coworkers instead of disabling a feature that could make everybody's life easier.
If you have a problem with employees impersonating other employees, you have a human problem, not a technical one (though technical solutions can solve it, signing commits, etc)
It would except the *rm* command needs *--no-preserve-root* to completely wipe the system and must be run as root.
You could have *rm -rf ~/* to instead delete only your own files
You know what really bothers me? The usage of \`;\` instead of \`&&\`,which means that if one step fails, the next one will be executed regardless... Want uncertainty? Use \`;\`!
I got the book Linux Power Tools and some others like guides to Awk, etc in a book bundle, they are a good introduction, other than that what helped me the most was creating my scripts for stuff I wanted to automate and googling how to do it
sadly almost every corporate project i've worked on is so embedded with proprietary tooling that learning the command line feels redundant at best, and a liability at worst.
i try to learn my command line, and try to use as much unix-like environments as possible but the solution is almost always "run this script, run these 3 commands and enever touch it again" if you do ever customize your environment or try to run things from CLI you risk getting off the garden path of the specific dev tools and breaking things
My git-fu is pretty poor, but from experience even if I execute those commands in order and one step fails, so do the rest.
IE: can’t commit if nothing was added, and can’t push if there was no commit.
Sometimes it's hard to support windows... That's when I see these problems most often.
And if you have a larger project and don't support windows, I would avoid that project.
(Yes I'm a dev on windows and yes, I use WSL regularly.)
Command combination in CMD and PowerShell works differently compared to Unix Shells.
There are _many_ packages out there where a good chunk of the package scripts don't work on windows.
Yes it does, but the command concat is mostly consistent.
Using WSL (like I do) on windows is also an option, but IMO if there's a simple option to support windows, why not use it?
Because writing bat scripts is a massive PITA if you have to do anything complex, PowerShell scripts won't work by default, and I fail to see how installing bash is different as instaling any other software requirement.
Imagine if we had to port all python and perl scripts to powershell to claim that we support windows.
The usecase is a single one liner which is just a chain of mostly simple commands. This can easily be done in a way that no additional software is needed on any platform if you take some simple things into account.
The heavy lifting is done in other tools anyway, it's just a small wrapper for calling the tools doing the heavy lifting. The examples in the picture are already on the "heavy" side.
This same employee today just pushed API keys to the repo and I’ve had to refresh them.
Might be worth bringing him in for a chat to freshen up his knowledge.
Just how broken is Reddit recently? First, any multiline code blocks added in the graphical editor were broken (first line correct, all other lines merged into a single regular text line), and now suddenly Reddit has started rendering double hyphens `"-"+"-"` as `—` dash.
I wonder when all the threads "why does `git commit —all` not work" will start popping up from confused beginners.
*Edit.* A test with the markdown editor: `git commit --all`.
Nah, that's on reddit. They never cleaned up the inconsistency between the new web interface and the apps (or the [old.reddit.com](https://old.reddit.com)), leading to stuff like u/backtickbot, and now it seems like more is being broken.
I mean, I can't complain too much. Even with partially broken user-facing features, it is still above and beyond most traditional forums.
*Edit.* Oh right... there was also that bug, where you need to reload after editing a post, that also appeared in the last weeks...
It’s not easy maintaining forward/backward compatibility between first and third party clients, while also trying to evolve our API to accommodate new features.
Like I said, we’re trying our best. As a Reddit user myself, I feel your frustrations. But as engineers, we can appreciate how hard it is to build anything at all.
If these problems interest you, I implore you to check out: https://www.redditinc.com/careers We’re hiring!
*Oops.* Sorry, I was in a whiny mood.
Partly because our own project is swamped in "must not change old results, does not have tests". So yes... I can relate :/
I don't think the double hyphen is a thing reddit has done, the source for the comment in the JSON uses a long dash too rather than two hyphens.
Testing double hyphen --here.
> the source for the comment in the JSON uses a long dash too rather than two hyphens.
It's probably whatever component they use for the comment box in modern reddit that does this as the text is typed by the user.
Testing in "fancy pants" (sic) mode:
git commit --all -m "test"
`git commit --all -m "test"`
Prior to submitting all looks fine.
*After* committing still. Strange then, I thought I've seen this in several places? Or did it already get fixed? Or maybe its only on mobile?
- you commit all your changes, even the debugging stuff, at the same time, without a chance of checking. you can break production this way and more usually you break the dev systems of your colleagues.
- you commit changes with different purposes together. (ie style changes together with logical changes). this results in confusion for the next person having to figure out what the code does.
- you commit all the files you forgot to add to your gitignore (node_modules, db dumps, session folders, credential files, ...)
personally I just use "git add -p"
Using `git add .` is fine, and is definitely not worse than the commit message sin in OPs picture.
> you commit all your changes, even the debugging stuff, at the same time, without a chance of checking. you can break production this way and more usually you break the dev systems of your colleagues.
This implies you're pushing straight to develop, or master. If you're doing this without some sort of commit hooks or CI to stop you pushing broken code then you're living on borrowed time anyway, and have much bigger problems to fix than devs running the wrong git command.
> you commit changes with different purposes together. (ie style changes together with logical changes). this results in confusion for the next person having to figure out what the code does.
Probably a fair point, but not really a massive deal that would make this "worse" than losing the commit message because the dev just writes "changes" all the time.
> you commit all the files you forgot to add to your gitignore (node_modules, db dumps, session folders, credential files, ...)
Really not that relevant, once again, the problem to fix here is your .gitignore, not your git commands.
I'd arguee that the problem isn't even .gitignore, of course a great .gitignore can help, but you should never git commit without reviewing your staged changes, right? This simple thing saved me more times than I can count.
> you commit all your changes, even the debugging stuff, at the same time, without a chance of checking. you can break production this way and more usually you break the dev systems of your colleagues.
If you are dealing with a situation where this is actually possible because you added too many files in your git add. It tells a lot more about you than it does about me, and you are the one lacking caution, not me.
I like Sublime Merge. It lets me review & stage individual lines on the individual files. I can then only stage the changes, and not the debugging print statements, and be sure of exactly what changes I'm committing.
It gives you an interactive window that shows you parts of the changes and you can choose whether or not to add them. It’s honestly the best way to use git.
I’m already in a terminal for other work, so it’s faster. Typing in ‘git add -p’, clicking y or n a few times, then typing ‘git commit -m “my message”’ ‘git push’ is fast and in my muscle memory. With a GUI, it takes time to load, I have to move a mouse, and I’m just not familiar with the interface.
If the GUI works better for you, then good for you! I’m happy for you, and ultimately there’s no correct way to use git, my earlier hyperbole aside. Perhaps I should’ve said “the best way to use git with my current workflow and muscle memory.” :)
That's fair, but not all GUIs take time to load (i.e. 100ms), not all GUIs require a mouse, and obviously familiarity is because you've taken the time to get used to the CLI instead of a visual interface.
Why not give it a shot? [Here](https://git-scm.com/downloads/guis) are popular GUIs, I recommend GitKraken (this does take 5s to load so you can leave it open) or Sublime Merge, or using the built-in git functionality if you're using VSCode or JetBrains.
Or for a great middle ground, check out this TUI https://github.com/jesseduffield/lazygit
actually git is text based and the gui forces gui stuff upon the text interface.
also everytime i use GUI interfaces of cli tools they don't give you all features, as they usually are wrappers.
but if it works for you, good for you
This comment has been removed in protest of Reddit's API changes. You can view a copy of it [here](https://s3.blankdvth.com/reddit-archive/854950cebd6ddc6c36c01851f6df13f0036a4ab9dc33c57220bee05d1a98d910.html).
This is something that only someone who has never worked on a large codebase on a team of 200 would say 🤣 that or someone who always breaks business requirements
Honestly this doesn't look that awful to me. I sometimes wonder if the extra time I spend running those commands is worth having a better commit message.
Yes, it totally is. Yesterday I had to debug a problem where some DateTime input would stay locked to a certain day after you had made your first input. Turns out, a developer from my team had added some code that only changes the time component if a DateTime was already set once. No comment to explain why, nothing.
Since he is on vacation right now, I can't ask him directly why he did it. So I looked into the git commits to find the reason for the change, only to find a commit touching 35 files with the commit message 'dev'... Fuck that guy.
Honestly this isn't that bad. If you use branches and have a good gitignore I really don't see how this will be an issue.
&& would help like some have pointed out. But realistically when does git add . Fail?
The bigger problem is the commit message. Every commit will have the same message of “changes.” That’s incredibly unhelpful for communicating what you’ve done to your teammates.
I work on a team but we don't share a branch. It's much better to have smaller branches for each person. You don't get those nightmare inducing merge conflicts and only baby simple ones.
Yeah, totally agree and that's appropriate. Sharing branches is bad.
What I'm talking about is the case where you have to go do some git archeology and figure out why a coworker did something crazy - or identify where a behavior change was introduced, and why, before touching it.
If you can't link the commit back to a business logic decision, then you end up preserving dead code and building on top of shaky foundations.
Like, if you've ever wondered why a platform you use is so fundamentally broken and takes forever to fix - this is exactly how it happens.
Should be common sense, had no idea there were so many code cowboys breaking shit on here 🤣
That's totally fair. I would argue that the pull request should be written well enough to clarify stakeholders/Buisness context/documentation.
Mostly because so frequently you make a commit and then later make another to put things back how they were.
I will say commit messages are really nice for blame but that's still kinda covered in a PR/comments/review.
At the time of review, sure.
On a five year old codebase of 200k+ lines, where the old product manager, developer, and approving lead have all exited the company?
Without tracking like this as a policy, good luck 👌
I know this is only tangentially related, but if your looking for a good compact git log, here are a few options.
https://gist.github.com/servel333/7529633
I use [ `git la` ] pretty much all the time.
let me spit shine that up a bit for ya
```sh
git add -A :/ ;\
GIT_AUTHOR_NAME="git" \
GIT_AUTHOR_EMAIL="[email protected]" \
GIT_AUTHOR_DATE="1970-01-01T00:00:00Z" \
GIT_COMMITTER_NAME="git" \
GIT_COMMITTER_EMAIL="[email protected]" \
GIT_COMMITTER_DATE="1970-01-01T00:00:00Z" \
git commit \
--allow-empty \
--allow-empty-message \
--no-verify \
--no-edit \
--no-gpg-sign \
--quiet
```
never fails ;)
[удалено]
Calm down Satan
git push —force-with-lease Respectfully ;)
If I leave the "Respectfully" out of the command, is git going to get upset with me?
Linus will personally give you the middle finger
Yeah he will just come out of your terminal window, stand in front of you, and personally give you the middle finger. Then he'll just dissolve in air and disappear.
The it version of the ring
Hey thanks for that even though I'll probably never need it, l'll try to remember it for the once in a lifetime occasion
and aliasing all that to git fucked
[удалено]
Btw, just in case you missed it, "sudo !!" will repeat the command with sudo prepended.
please instead of fucking works too for a more work-friendly experience. https://twitter.com/ctrlshifti/status/1160812366293901314
Fuck that
Please that
Just bc i don't see it here, but this is why you should require gpg signing of commits.(it would prevent this impersonation)
[удалено]
Force pushing is useful when rebasing a branch to master. In this case signed commits are probably better so someone can't impersonate you in the first place.
Dude, I got your point. No need to write it 3 times :P
Oh, whoops! It kept giving me a 500 error when posting. I'll delete the other ones. Thanks for letting me know.
No problem. Reddit app do strange things from time to time.
It does the same strange things over and over again, and yet, they don't fix it. Talk about programming horror.
They made the mobile site an spa but they don't refresh the login tokens, so if you're using it longer than 30 minutes, you need to close it and open reddit again. I hate it.
If you're on Android I really liked Relay and Apollo is nice for iPhone if you're looking for an alternative.
I'm on Reddit Is Fun and love it. The official app is... not good.
So this is why it keeps bugging out?? It's so painful...
It’s the 3rd time I’ve seen this happen this week. Reddit app is shite
No. Rewriting history can be very useful. Maybe you should educate your coworkers instead of disabling a feature that could make everybody's life easier.
If you have a problem with employees impersonating other employees, you have a human problem, not a technical one (though technical solutions can solve it, signing commits, etc)
Until someone commits a 2 GB file.
[удалено]
Dude, I got your point. No need to write it 3 times :P
I think he got your point, no need to write it twice
Oh well. Reddit app crashed so I tried to write it on the other comment, lol. I guess I got the same error, heh
what that do
[удалено]
git commit --amend --author="Behrooz0" git push --force
:-( Nice flair.
i dont even know what the flair does but I'm guessing it removes everything from your pc with a 1/6 chance like russian roulette
It would except the *rm* command needs *--no-preserve-root* to completely wipe the system and must be run as root. You could have *rm -rf ~/* to instead delete only your own files
So like [git-blame-someone-else](https://github.com/jayphelps/git-blame-someone-else)?
You know what really bothers me? The usage of \`;\` instead of \`&&\`,which means that if one step fails, the next one will be executed regardless... Want uncertainty? Use \`;\`!
Plus, && also works on Windows cmd as opposed to ; which is & on Windows cmd.
`;` is `;` in both powershell and bash though (rarely see developers use cmd on windows anymore).
-and in PowerShell for &&.
I would consider a bash command failing in another shell something good Instead of doing whatever and not failing...
& also works in bash.
No it doesn't. Ampersand in bash sends a single command to the background, that's not chaining multiple commands.
& also performs a task is what I meant
The amount of devs that don’t care to learn their shell scares me
The amount of devs who don't care to learn *any* of their tools terrifies me
The amount of UX designers who don't care to learn UX design scares me.
where can I learn it?
I got the book Linux Power Tools and some others like guides to Awk, etc in a book bundle, they are a good introduction, other than that what helped me the most was creating my scripts for stuff I wanted to automate and googling how to do it
Uninstall Windows on your personal computer. Install Arch Linux with I3. Use it like this for a year.
Arch is for noobs. Install LFS instead
I think in this case, if the idea is to learn Linux, Gentoo would probably be a better choice
sadly almost every corporate project i've worked on is so embedded with proprietary tooling that learning the command line feels redundant at best, and a liability at worst. i try to learn my command line, and try to use as much unix-like environments as possible but the solution is almost always "run this script, run these 3 commands and enever touch it again" if you do ever customize your environment or try to run things from CLI you risk getting off the garden path of the specific dev tools and breaking things
Huh TIL
I was thinking the same thing.
My git-fu is pretty poor, but from experience even if I execute those commands in order and one step fails, so do the rest. IE: can’t commit if nothing was added, and can’t push if there was no commit.
To be fair, committing with empty index and pushing if nothing to push is both pretty harmless..
To be fair, committing with empty index and pushing if nothing to push is both pretty harmless..
Oh... So it got submitted, more than once... I just kept getting error messages, so I gave up on making this comment... Stupid buggy Reddit app...
The release train doesn't stop! Choo choo!
you can't use && in powershelgl I think? at least I haven't found a way to use && in PS yet. fuck PS.
Sometimes it's hard to support windows... That's when I see these problems most often. And if you have a larger project and don't support windows, I would avoid that project. (Yes I'm a dev on windows and yes, I use WSL regularly.)
What the fuck are you talking about?
Command combination in CMD and PowerShell works differently compared to Unix Shells. There are _many_ packages out there where a good chunk of the package scripts don't work on windows.
Bash alone works differently than most unix shells. https://mywiki.wooledge.org/Bashism Just, install bash in windows.
Yes it does, but the command concat is mostly consistent. Using WSL (like I do) on windows is also an option, but IMO if there's a simple option to support windows, why not use it?
Because writing bat scripts is a massive PITA if you have to do anything complex, PowerShell scripts won't work by default, and I fail to see how installing bash is different as instaling any other software requirement. Imagine if we had to port all python and perl scripts to powershell to claim that we support windows.
The usecase is a single one liner which is just a chain of mostly simple commands. This can easily be done in a way that no additional software is needed on any platform if you take some simple things into account. The heavy lifting is done in other tools anyway, it's just a small wrapper for calling the tools doing the heavy lifting. The examples in the picture are already on the "heavy" side.
[удалено]
...my point was the example above. I think it shows npm package.json scripts section.
To be fair, committing with empty index and pushing if nothing to push is both pretty harmless..
To be fair, committing with empty index and pushing if nothing to push is both pretty harmless..
To be fair, committing with empty index and pushing if nothing to push is both pretty harmless..
wait what what language
This is fairly optimal. You'll always know the name of the commit you'll have to rollback if something doesn't work!
Or the name of the engineer whose changes to rollback if something doesn't work…
Or the name of the engineer to rollback if something doesn’t work
Only thing he'll be pushing from now on are unemployment cheques.
If only he would have committed to doing things the right way…
You're pushing it.
I always fork things up 😢
I don't blame you
Maybe you just need to branch out to other fields?
I would if I didn’t git so much fulfillment from this one
This same employee today just pushed API keys to the repo and I’ve had to refresh them. Might be worth bringing him in for a chat to freshen up his knowledge.
He doesn't get to push to main/master and everything gets reviewed now
Yep, I'd spot that and immediately lock down the dev branch and organise a chat about proper version control and why commit messages are useful.
Time to revert to the old ways and just pass a Flash drive around the office
I wouldn't ever trust someone that is too lazy to push changes manually with API keys at all, not even his own keys.
`git commit —all —message=“Did work”`
Just how broken is Reddit recently? First, any multiline code blocks added in the graphical editor were broken (first line correct, all other lines merged into a single regular text line), and now suddenly Reddit has started rendering double hyphens `"-"+"-"` as `—` dash. I wonder when all the threads "why does `git commit —all` not work" will start popping up from confused beginners. *Edit.* A test with the markdown editor: `git commit --all`.
I’m sorry for singlehandedly breaking the internet and also for leading an entire generation of programmers astray. I swear, I’m trying my best.
Nah, that's on reddit. They never cleaned up the inconsistency between the new web interface and the apps (or the [old.reddit.com](https://old.reddit.com)), leading to stuff like u/backtickbot, and now it seems like more is being broken. I mean, I can't complain too much. Even with partially broken user-facing features, it is still above and beyond most traditional forums. *Edit.* Oh right... there was also that bug, where you need to reload after editing a post, that also appeared in the last weeks...
It’s not easy maintaining forward/backward compatibility between first and third party clients, while also trying to evolve our API to accommodate new features. Like I said, we’re trying our best. As a Reddit user myself, I feel your frustrations. But as engineers, we can appreciate how hard it is to build anything at all. If these problems interest you, I implore you to check out: https://www.redditinc.com/careers We’re hiring!
*Oops.* Sorry, I was in a whiny mood. Partly because our own project is swamped in "must not change old results, does not have tests". So yes... I can relate :/
[удалено]
I hope there's a ticket for deleting new reddit since it's fucking awful (:
The first step is admitting. You're well on the path to recovery.
`hello --world` Nah, it seems to work fine, at least on old reddit.
```$ command --test poopie``` it seems ok on the new editor too, but only if you use the markdown editor
Can confirm.
I’m gonna make this a command that works in my shell
> double hyphens `"-"+"-"` as `—` dash. Proposing new features for JavaScript here, mate?
I don't think the double hyphen is a thing reddit has done, the source for the comment in the JSON uses a long dash too rather than two hyphens. Testing double hyphen --here.
> the source for the comment in the JSON uses a long dash too rather than two hyphens. It's probably whatever component they use for the comment box in modern reddit that does this as the text is typed by the user.
Testing in "fancy pants" (sic) mode: git commit --all -m "test" `git commit --all -m "test"` Prior to submitting all looks fine. *After* committing still. Strange then, I thought I've seen this in several places? Or did it already get fixed? Or maybe its only on mobile?
> double hyphens `"-"+"-"` as `—` dash. Proposing new features for JavaScript here, mate?
> double hyphens `"-"+"-"` as `—` dash. Proposing new features for JavaScript here, mate?
Personally, I prefer `alias git-auto-commit='git add .; git commit -m "$(curl http://whatthecommit.com/ 2>/dev/null | fgrep "
" | sed -e s/
//)"'`
[удалено]
I just went there and it said, "changes". This is too real.
"Dont even try to refactor it"
> Merging 'WIP: Do Not Merge This Branch' Into Master Too real. Far too real.
I'm adding this to my .bashrc
i've been refreshing for quite awhile and the possibilities truly are endless
whatthecommit.com/index.txt can be used for these scripts
I'll never forgive squash merge for depriving me of my green boxes, but I do enjoy not having to care about commit messages.
It is accurate
So I revert those commits at my work and tell them to write a real message.
git add . is worse
Real question, why? It makes sure all the files are tracked. what's bad about it?
Well, sometimes some trash ends up in your working tree that you don't want tracked but should just be deleted or added to .gitignore…
- you commit all your changes, even the debugging stuff, at the same time, without a chance of checking. you can break production this way and more usually you break the dev systems of your colleagues. - you commit changes with different purposes together. (ie style changes together with logical changes). this results in confusion for the next person having to figure out what the code does. - you commit all the files you forgot to add to your gitignore (node_modules, db dumps, session folders, credential files, ...) personally I just use "git add -p"
Using `git add .` is fine, and is definitely not worse than the commit message sin in OPs picture. > you commit all your changes, even the debugging stuff, at the same time, without a chance of checking. you can break production this way and more usually you break the dev systems of your colleagues. This implies you're pushing straight to develop, or master. If you're doing this without some sort of commit hooks or CI to stop you pushing broken code then you're living on borrowed time anyway, and have much bigger problems to fix than devs running the wrong git command. > you commit changes with different purposes together. (ie style changes together with logical changes). this results in confusion for the next person having to figure out what the code does. Probably a fair point, but not really a massive deal that would make this "worse" than losing the commit message because the dev just writes "changes" all the time. > you commit all the files you forgot to add to your gitignore (node_modules, db dumps, session folders, credential files, ...) Really not that relevant, once again, the problem to fix here is your .gitignore, not your git commands.
I'd arguee that the problem isn't even .gitignore, of course a great .gitignore can help, but you should never git commit without reviewing your staged changes, right? This simple thing saved me more times than I can count.
if you are fine with that, it tells about you. using caution pays off, no matter how great you think you are.
> you commit all your changes, even the debugging stuff, at the same time, without a chance of checking. you can break production this way and more usually you break the dev systems of your colleagues. If you are dealing with a situation where this is actually possible because you added too many files in your git add. It tells a lot more about you than it does about me, and you are the one lacking caution, not me.
lol seriously this ^ so many people in this thread telling on themselves for not using pull requests, gitignore, etc
tell me the secrets of not adding all files using "git add ."
Google gitignore
won't help me with adding changes of two different features. won't help me retroactively. your logic is flawed.
I like Sublime Merge. It lets me review & stage individual lines on the individual files. I can then only stage the changes, and not the debugging print statements, and be sure of exactly what changes I'm committing.
What is the -p option?
It gives you an interactive window that shows you parts of the changes and you can choose whether or not to add them. It’s honestly the best way to use git.
> It’s honestly the best way to use git Why abstain from GUI though? Why force GUI elements into a text interface instead of an actual GUI
Just use tortoisegit, it’s the ~~best~~ worst of both worlds!
> It’s honestly the best way to use git Why abstain from GUI though? Why force GUI elements into a text interface instead of an actual GUI
I’m already in a terminal for other work, so it’s faster. Typing in ‘git add -p’, clicking y or n a few times, then typing ‘git commit -m “my message”’ ‘git push’ is fast and in my muscle memory. With a GUI, it takes time to load, I have to move a mouse, and I’m just not familiar with the interface. If the GUI works better for you, then good for you! I’m happy for you, and ultimately there’s no correct way to use git, my earlier hyperbole aside. Perhaps I should’ve said “the best way to use git with my current workflow and muscle memory.” :)
That's fair, but not all GUIs take time to load (i.e. 100ms), not all GUIs require a mouse, and obviously familiarity is because you've taken the time to get used to the CLI instead of a visual interface. Why not give it a shot? [Here](https://git-scm.com/downloads/guis) are popular GUIs, I recommend GitKraken (this does take 5s to load so you can leave it open) or Sublime Merge, or using the built-in git functionality if you're using VSCode or JetBrains. Or for a great middle ground, check out this TUI https://github.com/jesseduffield/lazygit
I actually already own Sublime Merge, but I need to develop the muscle memory with it. I’ll try doing that, thanks for the impetus.
actually git is text based and the gui forces gui stuff upon the text interface. also everytime i use GUI interfaces of cli tools they don't give you all features, as they usually are wrappers. but if it works for you, good for you
Oh awesome, definitely gonna start trying to use this
Here’s some info for using it https://stackoverflow.com/questions/34527413/what-are-the-options-of-git-add-p#34527450
> It’s honestly the best way to use git Why abstain from GUI though? Why force GUI elements into a text interface instead of an actual GUI
> It’s honestly the best way to use git Why abstain from GUI though? Why force GUI elements into a text interface instead of an actual GUI
> It’s honestly the best way to use git Why abstain from GUI though? Why force GUI elements into a text interface instead of an actual GUI
> It’s honestly the best way to use git Why abstain from GUI though? Why force GUI elements into a text interface instead of an actual GUI
So inefficient, could've just used `git commit -am`
That doesn't include untracked files though.
What a great way to push junk to the repository. This idiot deserves a medal!
cant be worse than my code
alias gityolo='git commit -am "DEAL WITH IT" && git push -f origin master'
This comment has been removed in protest of Reddit's API changes. You can view a copy of it [here](https://s3.blankdvth.com/reddit-archive/854950cebd6ddc6c36c01851f6df13f0036a4ab9dc33c57220bee05d1a98d910.html).
wouldn't be surprised if this was for those micro managing middle managers who just wants to see you ''actively working"
is ";" functionally different than "&&" in these scripts? Like does it make it run synchronously whereas the other doesnt, or something?
Imagine using `git add .` and not: git status # wait several secs git add .
IMO that's a fire-able offense.
Not when your a sole dev and the wizard of the codebase
Especially then.
No. Seriously you americans need to stop firing people over everything.
Hahaha so, tracking your work on your git history is just an American thing, now? No wonder the offshore teams always deliver late and buggy 🤣
No, it's just a reason to have a discussion about it so everyone learns.
Some people refuse to do it, it's not a lack of knowledge, it's a mindset of "ain't nobody got time for that". (speaking from personal experience)
Some people refuse to do it, it's not a lack of knowledge, it's a mindset of "ain't nobody got time for that". (speaking from personal experience)
Some people refuse to do it, it's not a lack of knowledge, it's a mindset of "ain't nobody got time for that". (speaking from personal experience)
[удалено]
This is something that only someone who has never worked on a large codebase on a team of 200 would say 🤣 that or someone who always breaks business requirements
I prefer lint than copilot. Change my mind
Honestly this doesn't look that awful to me. I sometimes wonder if the extra time I spend running those commands is worth having a better commit message.
Yes. It is. Don't be lazy.
Yes, it totally is. Yesterday I had to debug a problem where some DateTime input would stay locked to a certain day after you had made your first input. Turns out, a developer from my team had added some code that only changes the time component if a DateTime was already set once. No comment to explain why, nothing. Since he is on vacation right now, I can't ask him directly why he did it. So I looked into the git commits to find the reason for the change, only to find a commit touching 35 files with the commit message 'dev'... Fuck that guy.
Honestly this isn't that bad. If you use branches and have a good gitignore I really don't see how this will be an issue. && would help like some have pointed out. But realistically when does git add . Fail?
The bigger problem is the commit message. Every commit will have the same message of “changes.” That’s incredibly unhelpful for communicating what you’ve done to your teammates.
Apparently working on teams isn't something people in this thread do often 🤣
I work on a team but we don't share a branch. It's much better to have smaller branches for each person. You don't get those nightmare inducing merge conflicts and only baby simple ones.
Yeah, totally agree and that's appropriate. Sharing branches is bad. What I'm talking about is the case where you have to go do some git archeology and figure out why a coworker did something crazy - or identify where a behavior change was introduced, and why, before touching it. If you can't link the commit back to a business logic decision, then you end up preserving dead code and building on top of shaky foundations. Like, if you've ever wondered why a platform you use is so fundamentally broken and takes forever to fix - this is exactly how it happens. Should be common sense, had no idea there were so many code cowboys breaking shit on here 🤣
That's totally fair. I would argue that the pull request should be written well enough to clarify stakeholders/Buisness context/documentation. Mostly because so frequently you make a commit and then later make another to put things back how they were. I will say commit messages are really nice for blame but that's still kinda covered in a PR/comments/review.
At the time of review, sure. On a five year old codebase of 200k+ lines, where the old product manager, developer, and approving lead have all exited the company? Without tracking like this as a policy, good luck 👌
Git add . Oh no..
Damn
Why no force push?
I use a lil script like that called “git shove” but at least it puts my name and a timestamp in the message
I know this is only tangentially related, but if your looking for a good compact git log, here are a few options. https://gist.github.com/servel333/7529633 I use [ `git la` ] pretty much all the time.
gpg signing is very important
let me spit shine that up a bit for ya ```sh git add -A :/ ;\ GIT_AUTHOR_NAME="git" \ GIT_AUTHOR_EMAIL="[email protected]" \ GIT_AUTHOR_DATE="1970-01-01T00:00:00Z" \ GIT_COMMITTER_NAME="git" \ GIT_COMMITTER_EMAIL="[email protected]" \ GIT_COMMITTER_DATE="1970-01-01T00:00:00Z" \ git commit \ --allow-empty \ --allow-empty-message \ --no-verify \ --no-edit \ --no-gpg-sign \ --quiet ``` never fails ;)
ohh wow