Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.

Questions tagged [git]

For code which accesses or manipulates a Git repository

Filter by
Sorted by
Tagged with
2 votes
2 answers
115 views

I have php website for prevent hacker modify any file and inject backdoor. I want to use git as a file tracking solution. This is my shell script: ...
Anas's user avatar
  • 129
2 votes
1 answer
82 views

This is my first time creating a non-trivial database and I was wondering what I could do better. As the title says this will be used a in toy version control system. Most of my choices feel "...
Doruk's user avatar
  • 423
5 votes
2 answers
2k views

I have a Dockerfile with ubuntu:22.04 as a base image and a manual Python installation(specific version i.e., 3.11.1) layer which takes a long time. Approach 1: ...
shaik moeed's user avatar
6 votes
1 answer
67 views

TestAssignment is a Python class designed to check certain conditions in a Git repository. It has several methods that check for the existence of required files, ...
Beki's user avatar
  • 61
12 votes
4 answers
2k views

I created this bash script to make it easy to publish your files to a GitHub repository. ...
Logan's user avatar
  • 221
2 votes
1 answer
181 views

I'm working on a personal project to build an open-source gui for git. I'm hoping to learn a lot from the project, and maybe produce something useful for folks as I do. I'm making use of libgit2 to ...
Stephen Hern's user avatar
-2 votes
1 answer
158 views

The following aliases return all the same number of results, on my Cygwin (on Windows): ...
user3341592's user avatar
0 votes
1 answer
132 views

I have this public repository. Since it's the first repository I have created, I'm looking for tips on what should I improve (mainly in the GH project structure), although tips in the code would be ...
Javi Torre's user avatar
3 votes
1 answer
94 views

After having a good experience with virtualenvwrapper built on top of the venv, I thought maybe it could be benefitial to have similar shortcuts for standard activities with git which could be time ...
J. Doe's user avatar
  • 131
2 votes
1 answer
76 views

This shell script, with only a few configurations, has the goal of initializing a project on Gitlab.com without having to go through the go through the website's ui. This means: Let's say you just a ...
Najmaoui Yassir's user avatar
9 votes
1 answer
726 views

I have recently been in a situation where multiple developers worked on a shared local git repository under the same Linux user¹. As one can imagine, it can easily become a bit annoying not to commit ...
AlexV's user avatar
  • 7,363
3 votes
1 answer
103 views

I am looking for a bit of help. I am having to cycle through 1400 clients code on my server, I have to check what Version of the software they are on and check for customization's to the code so when ...
Computer guy next door's user avatar
1 vote
1 answer
97 views

here's the updated version of the code for being reviewed. Fixes: "private" _cg function functions definition as ...
Felixoid's user avatar
  • 155
4 votes
1 answer
317 views

I'd like to get a review for the function that cd into the git tree root or does nothing if we are outside of the repository. reviewed version: ...
Felixoid's user avatar
  • 155
5 votes
2 answers
135 views

The code should do the following in order: It should download/clone the public Github repository locally. It should remove all the git history (and branches) Use the Github API to create a new Github ...
Krishna's user avatar
  • 51
2 votes
1 answer
85 views

At work, my team hosts a daily standup, in which we discuss what we're working on, what we did the day before and any potential blockers for future development. I thought as a fun little side project ...
Jessica's user avatar
  • 910
3 votes
1 answer
72 views

Improved version of the original question I've created a simple npm module and CLI program to get the latest GitHub and Bitbucket release from their APIs using Node.js. Please tell me if there's ...
user avatar
9 votes
1 answer
92 views

Solved, question with improved code I've created a simple npm module and CLI program to get the latest GitHub and Bitbucket release from their APIs using Node.js. Please tell me if there's anything to ...
user avatar
3 votes
1 answer
87 views

I'm using the following lump of code to manage a 9.4gb dataset. I had to divide the dataset into multiple github repositories to be able to do this. I've explained what each block of code does. <...
Levent Ozbek's user avatar
2 votes
0 answers
370 views

I am writing a small application to get commits between two tags from different env (apple, banana) and write the result into a csv file. For security, I have to replace some sensitive information ...
jacobcan118's user avatar
8 votes
2 answers
278 views

I often find myself doing rebase manually in an interactive form in a way as follows. Say I want to squash two last commit to third commit. First I execute: ...
menteith's user avatar
  • 311
8 votes
1 answer
125 views

I would appreciate any review of the following script I recently posted on GitHub (gitcrypto). Most notably, I would be interested in a review of the cryptographic aspects (I am not an expert in this ...
Andrei Borac's user avatar
6 votes
1 answer
231 views

I've written the below bash script to run as a pre-commit hook. The intention is to check the git staging area for any files larger than 1mb, and prevent the commit if any are present. ...
Rudi Kershaw's user avatar
8 votes
1 answer
928 views

I implemented a Python script that generates git commits for the last year making one's Contribution Graph look full of changes. It was my first Python program (I work mostly with Java). Although the ...
Sasha Shpota's user avatar
9 votes
2 answers
346 views

I have scripts to display commit statistics and merge statistics of my repos, and they work. I wrote them for my personal usage, and because I was interested in finding trends in my git repos. This ...
D. Ben Knoble's user avatar
3 votes
2 answers
132 views

I made a script for a project I'm working on to create a tree object from a filesystem directory, without any working tree operations (can be run in a bare repository). The tree can be inserted into (...
Emma Talbert's user avatar
3 votes
1 answer
96 views

It's a simple bash script but I'm hoping for feedback, advice and examples on how to improve the script and code. Can you guide me how to put more checks in the code and more if possible? This code: ...
somethingSomething's user avatar
4 votes
2 answers
1k views

This Python script does following activities: clone repo, as provided from the list creating a new branch "jenkinsMigrate" rename Jenkinsfile to Jenkinsfile.migrate push code to GitHub in a new ...
Here_2_learn's user avatar
4 votes
1 answer
502 views

Coming from Python, JavaScript and PHP, I'd like to learn to write Ruby in the way it's "supposed to". Well-written Python code is called "Pythonic", so I'd like to know how idiomatic my Ruby code is. ...
Richard de Wit's user avatar
3 votes
2 answers
410 views

I'm doing a lot of Python development lately for various (small-)data analysis pipelines at work. I've been wrestling with how to robustly and ~automatically version the code at a fine-grained level, ...
hBy2Py's user avatar
  • 257
4 votes
2 answers
357 views

I have built a generator that, using the GitHub API, creates a dictionary containing a tree of all the resources in any GitHub repo. It uses the function git_tree, ...
moltarze's user avatar
  • 455
3 votes
1 answer
707 views

I had searched for a solution to mvn clean install on my changed projects after a git pull. I even asked a question over at SO ...
CodeMonkey's user avatar
10 votes
1 answer
122 views

In order to avoid having to make any real progress (at least for a short time), I wrote a script that measures how much progress I have made so far, instead. Specifically, this script sums up the file ...
Graipher's user avatar
  • 41.7k
5 votes
1 answer
919 views

In my company, we use git as VCS, the main server run under linux but all our code is for Windows and we all develop on Windows. The git tag system is case sensitive on linux but is case insensitive ...
Orace's user avatar
  • 167
8 votes
1 answer
180 views

I wrote a Perl script to import local files with "File-Ending-Versioning" (like file.1.12.pm) into a Git repository. I tried to use the concept of roles ...
yulivee's user avatar
  • 181
11 votes
1 answer
275 views

A long time ago I implemented some code to walk the git commit graph. I recently updated the accompanying analytics part of the code base to follow file moves/renames in order to get a more accurate ...
RubberDuck's user avatar
  • 31.2k
2 votes
1 answer
267 views

The aim of this script is to snapshot the current working directory of a git repository to another branch. Afterwards, it switches back to the original branch and restores the original state, ...
danijar's user avatar
  • 205
2 votes
2 answers
210 views

I am trying to learn Kotlin. I am coming from some background in Java. As a learning exercise, I wrote this simple program to summarize occurrences of a string by author email in a list of git ...
jack's user avatar
  • 23
0 votes
1 answer
388 views

As in many teams, me and my coworkers are putting ticket number into beginning of each commit message. If your branches are starting with ticket number it is easy to create ...
askhat's user avatar
  • 123
1 vote
0 answers
342 views

While setting up my Jenkins instance with Ansible to connect to our local GitHub Enterprise instance, I need to recreate what the Github Branch Plugin does to scan an Organizations projects and pre-...
Xetius's user avatar
  • 119
5 votes
1 answer
2k views

In my deployment I need to generate a zip file from a git repo. I have the basic work done with how to pull the latest tag and create the zip file. I ended wanting to update the files that are pulled ...
Josh Knutson's user avatar
13 votes
5 answers
3k views

I have written a shell script utility for deleting all merged local branches. ...
Rudi Kershaw's user avatar
3 votes
1 answer
1k views

This seems to be working but also is quite horrendously slow and seems a little hacky to me. ...
Geesh_SO's user avatar
  • 193
1 vote
1 answer
89 views

At my office we have an internal monitoring tool we use on customer systems to monitor various vitals and notify us via Slack. Our Lead Dev and Chief Architect are very paranoid about Git, and ...
Mayube's user avatar
  • 181
8 votes
1 answer
2k views

I'm learning Go, and this is my first attempt at a command-line tool that uses the GitHub API to calculate the average time that takes for a pull request to get merged for a particular organisation or ...
UnsafePointer's user avatar
3 votes
2 answers
80 views

Background My team develops in a git monorepo. User stories are broken into very small discrete sub-tasks and merged directly into master, rather than into a ...
msanford's user avatar
  • 391
1 vote
2 answers
114 views

I have a method that looks like the method below, and I can't help but shake the feeling that it can be improved. It doesn't really "read" well, and it seems like ...
Brad Werth's user avatar
4 votes
1 answer
108 views

I just finished writing this Python script to calculate daily additions and subtractions from my git log to use in making pretty graphs. This is a rewrite of something I wrote previously in Perl. I ...
HSchmale's user avatar
  • 925
3 votes
0 answers
261 views

I took the agnoster theme and re-wrote it to this: ...
user avatar
6 votes
0 answers
134 views

I created a small-ish NodeJS script which takes as argument the name of a Wikipedia article (and optionally a Wikipedia edition, "en" is default) and creates a Git repository with each ...
Bruno Pérel's user avatar