Git

3044 readers
1 users here now

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Resources

Rules

  1. Follow programming.dev rules
  2. Be excellent to each other, no hostility towards users for any reason
  3. No spam of tools/companies/advertisements. It’s OK to post your own stuff part of the time, but the primary use of the community should not be self-promotion.

Git Logo by Jason Long is licensed under the Creative Commons Attribution 3.0 Unported License.

founded 2 years ago
MODERATORS
201
14
Gitlab is down (lemmy.fmhy.ml)
submitted 2 years ago by [email protected] to c/git
 
 

Guess I get to take a half day. Perfect start to my weekend.

202
4
submitted 2 years ago* (last edited 2 years ago) by canpolat to c/git
203
204
205
206
 
 
207
 
 

Hey folks,

This is an update to: https://sh.itjust.works/post/580838

On https://github.com/csm10495/commit-ment, I made it to somewhere around 22 million commits. I can't imagine this is not a world record for commits to a single branch. In the middle of the night, I got an email from GitHub support saying:

A few minutes later, I got another email like so:

I've asked them if the two emails are related (and I guess if the first one is some sort of error since there was no personal info in that repo). I've also asked if they can give any information about what triggered the email and if they can give me more info about what it looks look on their side.

I've also asked if they can re-enable it so I can give one more commit to say the final results on the readme then (public) archive it.

We'll see what they say.

Doing a pull is interesting at the moment, it shows:

git pull origin master --no-rebase -vvv
ERROR: Access to this repository has been disabled by GitHub staff due to
excessive resource use. Please contact support via
https://support.github.com/contact to restore access to this repository.
Read about how to decrease the size of your repository:
  https://docs.github.com/articles/what-is-my-disk-quota

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Similar thing happens if you try to clone: [email protected]:csm10495/commit-ment.git

So yeah, I figured this would happen sooner or later. I just hope they can tell me a bit more about what it looks like on their side since managing this repo on my box is a pain, I can't imagine what it could look like on theirs. I'm also curious how pull requests could merge at such a rate given that just doing a pull on my end could take minutes. So many questions!

This whole project was really just for curiosity on my end, so anything I can learn/find out is much appreciated on all ends.

Anyways, just figured I'd update y'all.

208
209
210
47
submitted 2 years ago* (last edited 2 years ago) by [email protected] to c/git
 
 

I decided to see how many commits GitHub (and git) could take before acting kind of wonky. At ~19 million commits (and counting) to master: it's wonky.

The GitHub API has periodic issues merging/creating PRs. (I use PRs since that is more reliable than keeping a local master up to date via pulling at this point).

GitHub reports... infinity infinity commits. Doing a full clone from GitHub Actions is taking around 2 hours.

Using:

git pull origin master

to update my local master hangs for a while before even printing anything.

If anyone has seen a public GitHub repo with more commits to its main branch, let me know.

If anyone wants to see how slow wonky git acts at this scale, feel free to clone.

Edit: Update to this post is: https://sh.itjust.works/post/672069

211
309
Your Git horror stories (programming.dev)
submitted 2 years ago* (last edited 2 years ago) by canpolat to c/git
 
 

We all have been there... For the beginner it's easy to mess things up. What are your horror stories with Git?

Link to xkcd

212
 
 

Easily create video animations (.mp4) of your Git commit history, directory from your Git repo.

213
 
 

Found this project which seems to provide lots of QoL things on top of git. Btw, this project is not maintained. Any alternatives for simpler git UI welcome.

214
16
submitted 2 years ago by canpolat to c/git
 
 

checkout is one of the most confusing commands for new comers. This Stackoverflow explains how it can be replaced with switch and restore.

  • git switch can now be used to change branches, as git checkout <branchname> does
  • git restore can be used to reset files to certain revisions, as git checkout -- <path_to_file> does
215
26
submitted 2 years ago* (last edited 2 years ago) by [email protected] to c/git
 
 

I basically only use git merge like Theo from T3 stack. git rebase rewrites your commit history, so I feel there's too much risk to rewriting something you didn't intend to. With merge, every commit is a real state the code was in.

216
 
 

cross-posted from: https://programming.dev/post/222613

Although I prefer the Pro Git book, it's clear that different resources are helpful to different people. For those looking to get an understanding of Git, I've linked to Git for Beginners: Zero to Hero 🐙

The author of "Git for Beginners: Zero to Hero 🐙" posted the following on Reddit:

Hey there folks!

I've rewritten the git tutorial. I've used over the years whenever newbies at work and friends come to me with complex questions but lack the git basics to actually learn.

After discussing my git shortcuts and aliases elsewhere and over DMs it was suggested to me that I share it here.

I hope it helps even a couple of y'all looking to either refresh, jumpstart or get a good grasp of how common git concepts relate to one another !

It goes without saying, that any and all feedback is welcome and appreciated 👍

TL;DR: re-wrote a git tutorial that has helped friends and colleagues better grasp of git https://jdsalaro.com/blog/git-tutorial/

EDIT:

I've been a bit overwhelmed by the support and willingness to provide feedback, so I've enabled hypothes.is on https://jdsalaro.com for /u/NervousQuokka and anyone else wanting chime in. You can now highlight and comment snippets. ⚠️ Please join the feedback@jdsalaro group via this link https://hypothes.is/groups/BrRxenZW/feedback-jdsalaro so any highlights, comments, and notes are visible to me and stay nicely grouped. Using hypothes.is for this is an experiment for me, so let's see how it goes :)

https://old.reddit.com/r/learnprogramming/comments/14i14jv/rewrote_my_zero_to_hero_git_tutorial_and_was_told/

217
 
 

Hey folks!

I've noticed that it's often difficult for newcomers to git to understand what the heck is happening and how the commands work.

Here's a flowchart that has helped me explain things in the past, and (more than once) folks have asked me for a copy of it to use as a cheat sheet. Hope it's helpful!

218
 
 

Have you ever used git bisect? If so, how did you use it? Did it help you find a problem which would otherwise be difficult to find? Story time, I guess?

219
 
 

Which courses or tutorials helped you most to improve your understanding of Git? Can you recommend and free/paid resources to beginners?

220
14
git rerere (www.git-scm.com)
submitted 2 years ago by canpolat to c/git
 
 

The git rerere functionality is a bit of a hidden feature. The name stands for “reuse recorded resolution” and, as the name implies, it allows you to ask Git to remember how you’ve resolved a hunk conflict so that the next time it sees the same conflict, Git can resolve it for you automatically.

221
6
Git man page generator (git-man-page-generator.lokaltog.net)
submitted 2 years ago by canpolat to c/git
222
 
 

posh-git is a PowerShell module that integrates Git and PowerShell by providing Git status summary information that can be displayed in the PowerShell prompt, e.g.:

example

223
 
 

This is a pretty neat tool that allows you to use regular git commands, but captures the output as a PowerShell objects. This allows you to use the power of PowerShell pipelines to enhance your git experience.

A couple of examples:

# Count logs by author
git log |
        Group-Object GitUserEmail -NoElement |
        Sort-Object Count -Descending
# Delete all branches except the current and main
git branch | 
        Where-Object -Not IsCurrentBranch | 
        Where-Object BranchName -NotIn 'main', 'master' | 
        git branch -d
224
11
submitted 2 years ago by canpolat to c/git
225
 
 

I just found this. I could have used it the other day.

view more: ‹ prev next ›