git single file

Sometimes you just need a single file from a git repo. I know that this is not the typical way we use git, but sometimes you just need to do a thing. So I want a single file, how do i do that? git archive --format=tar --remote=ssh://git@github.com:someuser/somefile.git{main} -- my_file_name |tar xf - and like that you can snag one file from one repo and get on with your life.

2023-03-03 · 1 min · 69 words · Mike Fettis

unique .gitconfig

using multiple .gitconfig There is a neat feature in .gitconfig that will allow you to use uniueq gitconfig depending on the folder structure that you have. For example add this to your global gitconfig: This is assuming that ~/github has one org of repos, and ~/git has another, much lke personal and corporate git repos [includeIf "gitdir:~/git/"] path = ~/git/.gitconfig [includeIf "gitdir:~/github/"] path = ~/github/.gitconfig Then if you add this is the correpsonding location, the user name/email will be different in each folder structure....

2020-04-30 · 1 min · 103 words · Mike Fettis

git codeowners gpox

Some git notes I like git I user git a lot, I did not know about CODEOWNERS, this is a nice feature. automatic PR approver to a repo Adding codeowners can allow for automatic PR approvers for branches or all things github.com about-code-owners You can use a CODEOWNERS file to define individuals or teams that are responsible for code in a repository. To use a CODEOWNERS file, create a new file called CODEOWNERS in the root, docs/, or ....

2019-11-12 · 2 min · 318 words · Mike Fettis

git bfg cleaner

Git got big files or keys? Break out BFG Everybody messes up, today’s mistake was adding a big file to git before a .gitignore was in place to handle it. As a result, github is rejecting the push, even after “removing” the file from git. The reason is that the file still exists in git(history). Time to clean up the mess, break out BFG and nuke it from orbit. -Sadly this means java is involved, but necessary demons....

2018-11-13 · 3 min · 619 words · Mike Fettis

2017-03-06 git, splunk, lastpass-cli

git Git should know better and totally commit and add files that I was working on last night. I left an uncommited file sitting on a laptop at my house when I went to work today… Rookie mistake. for ALL the repos $ git config --global user.name "John Doe" $ git config --global user.email "john@doe.org" only for oen repo $ git config user.name "John Doe" $ git config user.email "john@doe.org" git aliases are cool add to your ....

2017-03-06 · 2 min · 233 words · Mike Fettis

2017-02-27 nginx, splunk, docker, git

Splunk and nginx Doing some splunkjs work from a docker container, and hosting it out of nginx, which means I needed to configure a proxy pass using some load balancing in order to access the splunk cluster, this was a little tricky because of session persistence and https. nginx load balancing Luckily there are some good pslunk blogs out there that help out configuring-nginx-with-splunk-rest-api-sdk-compatibility and some good reading about splunkjs read them both using-the-splunkjs-stack-part-1...

2017-02-27 · 1 min · 180 words · Mike Fettis

2017-02-25 ithub, git, jekyll, ruby, mac, docker, raspberrypi

Productive Saturday rant Been cranking away at my laptop from 630-830 this morning, and realizing that my ancient mac book air battery which was already replace once, is just a poor shadow of what it should be. I’m only going to get about 3 hours out of this battery before it dies. Which is sad because i really wanted to get a new laptop this year but mac did not really give us any options....

2017-02-25 · 3 min · 501 words · Mike Fettis

github one liner and powershell curl

Github releases There is a nice way to get the latest release from a github repo. as long as it gets tagged as release. I like to be able to pull down the latest version of a release for specific code in automated builds. This helps that. Use curl to get the JSON response for the latest release Use grep to find the line containing file URL Use cut and tr to extract the URL Use wget to download it...

1 min · 127 words · Mike Fettis

keeping secrets out of git

git-secrets I came across this handy piece of software today, called git-secrets. It is made by awslabs and it acts as a git-hook that will stop you form doing stupid things. https://github.com/awslabs/git-secrets

1 min · 32 words · Mike Fettis