Questions tagged [git]

Git is an open-source DVCS (Distributed Version Control System).

Filter by
Sorted by
Tagged with
-1
votes
0answers
23 views

Cloud Web and Gitlab-CI

I'm used to Gitlab, and now I want to start deploying with Gitlab-CI, directly on the server. I've an OVH Cloud Web 1 account. Currently, I made it work with this code in the .gitlab-ci.yml file and ...
2
votes
0answers
144 views

application to get git commit and write data into csv file

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 ...
7
votes
2answers
64 views

Fix last n commits to previous commit automatically

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: ...
7
votes
1answer
70 views

Incremental, encrypted backups for git

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 ...
6
votes
1answer
70 views

Pre-commit hook to prevent large file commits

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. ...
7
votes
1answer
189 views

A Python script that generates git commits for the last year

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 ...
8
votes
2answers
73 views

Display git commit statistics in bash

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 ...
2
votes
0answers
37 views

Middleware for authenticating GitHub webhooks

I'm currently working on a PSR-15 middleware for authenticating GitHub webhooks. ...
1
vote
0answers
31 views

Clojure test for Git operations

Is this code a good test for a testable Clojure code? ...
3
votes
2answers
31 views

git Create Tree from Arbitrary Directory (works in bare repository)

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 (...
1
vote
0answers
39 views

Project Management System focused on forking and web-of-trusting-code

I'm writing a project management system focused on forking and web-of-trusting-code, which is a fancy way of saying "take someone's code, do whatever you want with it, and see if others agree with you"...
3
votes
1answer
41 views

Syncing GitHub repositories local, remote and forks

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: ...
1
vote
0answers
165 views

Push multiple tag to multiple Github repositories using batch script

Push tags to multiple git repositories using a script in one go. Here first, we create a separate folder for git repository. Pull the repository. create a tag in local. push tag to the remote. In a ...
7
votes
1answer
63 views

ArXiV Technical Paper API Github Repo

My name is Ethan and I am trying to build an API for scaping technical papers to use for developers. Right now it only works for ArXiV but I would greatly appreciate some mentoring or a code review of ...
4
votes
2answers
193 views

automating to push changes to github for multiple repos using python

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 ...
4
votes
1answer
128 views

Download a Git repo without .git folder

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. ...
3
votes
2answers
111 views

bash wrapper around 'git commit' to automatically bump (Python) package CalVer and create matching CalVer tag on new commit

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, ...
4
votes
2answers
98 views

GitHub repo tree generator

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, ...
1
vote
0answers
60 views

Jenkins Powershell script to copy code from Github to AWS Lambda

This is a <10 line Jenkins powershell build step triggered by a git commit which zips code and copies to lambda. Seems to work fine for javascript projects. I check for the zip file and then remove ...
2
votes
1answer
188 views

Partial Maven clean install after Git pull

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 ...
5
votes
0answers
38 views

Measure size of repository as a function of time

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 ...
5
votes
1answer
413 views

Git hook to detect existing tag case insensitive

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 ...
7
votes
0answers
44 views

Perl Script to import flat-file versioned files into git repositories

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 in this script and I am not shure if I applied ...
11
votes
1answer
137 views

Counting times a file was committed to Git

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 ...
2
votes
1answer
51 views

Commit the working directory to different branch and switch back

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, ...
2
votes
2answers
62 views

Kotlin program to summarize git commits by regex match

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 ...
0
votes
1answer
231 views

Git hook written on JavaScript

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 ...
1
vote
0answers
153 views

Ansible scanning Github branches

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-...
5
votes
1answer
699 views

Create release package from git tag with Powershell

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 ...
1
vote
0answers
70 views

Vim commands for browsing git history of a file

I've been working on this mostly for myself until now, but I am now thinking that it might be worth uploading for other people to use. But first I wanted to ask what other people think because I don't ...
13
votes
5answers
2k views

Git delete all merged in local branches

I have written a shell script utility for deleting all merged local branches. ...
3
votes
1answer
363 views

Reset files in Git which show as modified but have no changes according to “git diff”

This seems to be working but also is quite horrendously slow and seems a little hacky to me. ...
1
vote
1answer
53 views

Git Autoupdater

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 ...
4
votes
0answers
626 views

Tool to calculate the average time that takes for a GitHub pull request to get merged

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 ...
3
votes
2answers
48 views

Safely pruning merged topic branches locally

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 ...
1
vote
2answers
63 views

Ensure that a directory reflects a specified Git commit

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 ...
4
votes
1answer
60 views

Daily Add/Del Git Log Analysis

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 ...
3
votes
0answers
119 views

Colorized zsh prompt with support for Virtualenv and Git

I took the agnoster theme and re-wrote it to this: ...
3
votes
0answers
38 views

Showing a Wikipedia article's changes as Git commits

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 change made to ...
4
votes
0answers
142 views

Bash script to symlink configuration files from git repo into home directory

My goals are to: Do it automatically (without adding a line to my script every time I add or change the location of a config file) The files in the git repo folder should not be hidden, but the ...
4
votes
0answers
3k views

Clone a GitLab private repo with Ansible

I have an ansible playbook that checks out a GitLab private repository. It utilizes the GitLab Users API to generate an SSH key for the target host and adds it to my GitLab user's SSH keys. This ...
8
votes
3answers
1k views

Bash: change git remote from SSH to HTTPS within a given dir

The code takes a user input dir path, then looks for git remote url that is still using SSH, and the repo is belong to an fixed Organisation. Then it will convert these repos' git remote url from SSH ...
2
votes
1answer
60 views

Generates a bare git repo from existing one and copy it to a central server

This is a Bash script that takes the name of a local Git repo and a remote server host/path, generates a bare repo, and copies the bare repo to a Git server located in another server. Example usage: ...
11
votes
2answers
902 views

Walking Git History

I've recently taken an interest in analyzing commit history to find files with a lot of churn. The idea being that high churn files are likely targets for refactoring. Right now it's a simple console ...
5
votes
2answers
54 views

Install, configure, and maintain content for Ubuntu webserver

I made a script for my Ubuntu server(s) running on Google Cloud Platform. The idea behind it is I can create a new instance and paste this script in Google Cloud so it runs it on the new instance and ...
2
votes
1answer
63 views

Rust GitHub repository downloader

I made a little program that allows users to download a local copy of all their GitHub repositories for backup purposes. I've tried to write idiomatic Rust code, but I'm sure there are ways I could ...
2
votes
2answers
40 views

Tag specific Git commits based on commit message contents

I am using GNU Bash 4.3, and Git 2.1.4, to tag certain git commits based on their commit messages. Specifically, I want to tag: as v0.0.1 the commit with message "...
4
votes
2answers
533 views

Bash script which downloads the latest linux stable kernel

I made this script when I started downloading the latest stable linux kernel's source from https://www.kernel.org to compile it myself, now I have improved it a bit and decided to create a public repo ...
3
votes
1answer
144 views

List all the git branches

I have written a toy script to list all the git branches in cwd. I am interested in knowing how can I make this code more modular and flexible. For example I would ...
4
votes
1answer
422 views

Python script to synchronise your locally cloned fork to its parent github repository

I recently wrote a python script that syncs your locally clone repository to its parent repository, so I would like you to review it and help me in improving it. ...