Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [git]

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

2
votes
1answer
40 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
27 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 ...
4
votes
1answer
30 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
37 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 ...
10
votes
1answer
87 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 ...
0
votes
1answer
39 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
48 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
69 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
35 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
235 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
39 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 ...
11
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
163 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
49 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 ...
3
votes
0answers
248 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
47 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
49 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
78 views

Colorized zsh prompt with support for Virtualenv and Git

I took the agnoster theme and re-wrote it to this: ...
3
votes
0answers
36 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
95 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 ...
3
votes
0answers
2k 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
586 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
44 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
640 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
50 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
52 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
33 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
344 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 ...
2
votes
1answer
106 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 ...
3
votes
1answer
241 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. ...
5
votes
0answers
65 views

Git pie - Perl oneliner for Git

I often make changes on my code-base and manually using sed, awk or perl -pi -e is not ...
5
votes
1answer
99 views

Breakable Toy: Go CLI for Gitlab

I started to learn programming in Go and came up with a Breakable Toy, which is a CLI for Gitlab. To get something up and running fast, I used some Go libraries: Ginkgo for testing Cobra for basic ...
8
votes
1answer
3k views

Elegantly handle github API requests exceptions

I have this code which creates a team using the github API and returns the team-id(success) or -1(failure). My problem is with the error handling. When the request responses with an error status code ...
6
votes
1answer
523 views

Avoiding shell injection when calling Git in Python

I'm developing a command line application in Python which processes information that users provide. I've been reading the Python documentation on this topic and found that the built-in module ...
10
votes
2answers
595 views

Taking YouTube links out of a list of GitHub repo READMEs

I have a .csv file that contains student GitHub repository assignment submissions. I made a script to go to each repository and extract the YouTube video that they must have provided in their README ...
10
votes
1answer
656 views

Automating the download of a GitHub repo

This script is designed to locate and download the first repository in your sidebar on the GitHub repository page. It downloads the .zip file for that repo and saves it to the default location. I ...
5
votes
1answer
73 views

Tool for blind users who also have NO speech

I'm building an (open source) online tool for users with NO speech who are also blind. The program steps through a list of utterances in a female 'thinking' voice, and when one is selected, speaks it ...
1
vote
1answer
45 views

Script to execute arbitrary command on each Git project in a directory

The idea is simple, most people have some one directory containing all their projects as subdirectories. When you are in the top directory and you run this script like so ...
2
votes
0answers
53 views

CLI app to download a .gitignore file

I have written a simple app that adds gitignore files to the current working directory - it does this by reading files hosted on GitHub and then saving them (...
10
votes
1answer
148 views

Automated backup of remote git repos

This is the first python script I've written. It's used to create a local backup of git repos from BitBucket. It works, but I'd like to make it more pythonic if possible. ...
4
votes
1answer
420 views

Manage Labels in a Gitlab Project

Background This is the first (and only) Go program I've written so far. My employer just formed a small team to make a prototype written in Go ready for production, so I (and everyone else on my ...
0
votes
0answers
210 views

Robust bash function to find the root of a git repository

I'm trying to write robust code which will print the root directory of a git repository. How can I improve this code for: Robustness Style (eg use of subshell ...
6
votes
1answer
577 views

Coloured bash prompt including git status and previous exit code

I wanted to create a short, informational and colourful prompt. My prompt includes: Exit status of last command (if not 0) Distinctive changes when root rsync-...
6
votes
1answer
269 views

Git tag release build files and reset to commit without

This is part of a library that wants to release builded files (eg dist/*) when published to npm and bower. However, I don't want to commit those builded files for ...
10
votes
1answer
2k views

Bash script to simplify Git deployment workflow

In my company I follow the following workflow. (I think it can be defined a kind of 'Continuous Integration'.) Workflow: We have 3 fixed branches (staging/...
2
votes
1answer
81 views

Makefile and main header file for a shell

My main.c includes this header file. Please let me know how I can improve it. I did my best but I don't know much about code conventions in C (I come from Java and ...
1
vote
1answer
38 views

Open github via commandline

I'm learning bash and my goal here is from any repository on my computer to be able to type github and it will open the remote ...
2
votes
1answer
317 views

Recursion into git diff tree using nodegit

I'm using nodegit to develop the backend for a nodejs app that uses a mix of mongodb and git for persistence. The app has to version documents and be able to present diffs between versions, thus the ...
2
votes
1answer
80 views

POSIX shell script using a string to store command arguments

Background I’ve started putting all my configuration files (which include many shell files) under version control. In the Git repository, I’ve configured a pre-commit hook that runs the ...