Git is an open-source DVCS (Distributed Version Control System).
4
votes
1answer
27 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.
...
3
votes
0answers
19 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 ...
6
votes
1answer
55 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 ...
7
votes
1answer
58 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
77 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
571 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
118 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
68 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 ...
2
votes
1answer
28 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 ...
3
votes
0answers
40 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 (...
8
votes
1answer
58 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
0answers
69 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
67 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
275 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
136 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 ...
7
votes
1answer
1k 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
52 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 ...
2
votes
1answer
34 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 ...
1
vote
1answer
103 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 ...
1
vote
1answer
39 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 ...
3
votes
1answer
45 views
Determining if a file or URL is a git repo or archive
I'm getting these three offenses:
libraries/helpers.rb:4:1: C: Method has too many lines. [11/10]
def get_files(url, file, destination)
^^^
...
3
votes
1answer
154 views
Bash function to parse git status
I have a function here and wondered how well this can be refactored.
I currently have this:
...
3
votes
0answers
66 views
Automatically push git submodule's parents recursively
I'm absolutely terrible with .bat files, but sometimes they are just needed. Right now I'm working on a project with quite some submodules, which have quite some ...
5
votes
1answer
98 views
GitHub API client
Here is my Haskell program designed to list all of my GitHub repos along with their descriptions and languages via the GitHub JSON APIs:
...
10
votes
3answers
897 views
Date of latest GitHub project release
I needed a clean, simple and robust piece of code to retrieve the date of publication of the latest release of a given GitHub Project.
My constraints were that it needed to be written in the C++11 ...
7
votes
1answer
71 views
Git Insert Delete Graph
I attempted to recreate the github code frequency graph(example) with a daily granularity using perl and git log. How did I do, ...
2
votes
1answer
106 views
GitHub Auto Copy Committer via API
I did write the GitHub Auto Copy Committer.
The purpose is to copy an existing public GitHub repository to in
another repository - commit per commit. It's reason is not a full copy
of a ...
2
votes
1answer
96 views
Git post-receive hook writen as a POSIX shell script (utilising a named pipe)
This is my first piece of code to post here. I wrote this script as a
post-receive hook for a Git repository but I’m not so concerned with the Git
parts (I’d like to have the part marked with ...
1
vote
1answer
74 views
Gathering metadata on files in GitHub
I am a relatively new programmer and am currently working on something with the egit GitHub client library which requires me to iterate over a bunch of values and if a condition is met, add a bunch of ...
6
votes
1answer
498 views
Automate branch merging with git
I wanted to learn how to use python to replace bash, and found this old post from 2008 or 2009. The output of git has changed a bit, though, so I decided to remake it.
I also decided to try out ...
7
votes
1answer
58 views
Perl pie alternative
Running on Cygwin, I cannot easily use perl -pi -e because it will always produce .bak files even though I don't want them. I ...
8
votes
1answer
179 views
Bash script to remove unwanted git objects
A while ago, someone at our office thought it'd be a great idea to start tracking a number of fairly large binary files in one of our more important repositories. We noticed our builds were slowing ...
3
votes
1answer
31 views
Bash Compress Managed Directory Ignoring .git, bower_components, node_modules, etc
Fairly easy way to compress a wordpress plugin (or similar) as a zip file without including all the dependencies used to create and manage the development, but which don't belong in the final product.
...
8
votes
1answer
120 views
Adding SecureString support to Lib2GitSharp
A library that I use doesn't support SecureString in its credentials for connecting to GitHub, so I'm submitting a pull request to add it. I know it's not ideal to ...
1
vote
0answers
132 views
Local branch update script using Git and PHP
I'm using Git and PHP to create an update script which is sync local branch and the master. It checks about new updates, and if yes, it proceeds to the Git pull request and any response got from the ...
5
votes
2answers
484 views
Use git to get SHA-1 of repo
I've created the function below to get the SHA-1 of the repository used by my CI server. The hash is then used to update the pass/fail status of the commit on GitHub.
I'm a python amateur. What ...
5
votes
1answer
229 views
Git merge script
The branches I need to merge are called test and test-passed. Merging will always be fast-forward, from test to test-passed as commits to test-passed are only done automatically from test. This is ...
3
votes
1answer
564 views
Python script that does a git diff
I have created a small script that aims on comparing two versions of a file by doing a git diff. Is there a better way to code it?
...
8
votes
1answer
453 views
Python-based Git pre-commit hook to manage multiple users/Git identities
A couple of months ago I posted a bash script to manage multiple Git identities as a solution on Stack Overflow but soon found the hook isn't flexible enough.
Thus I decided to rewrite the hook in ...
12
votes
1answer
4k views
Clone GitHub repository using Python
I want to backup my GitHub repositories since there is news about blocking GitHub in India. I wrote Python code to automate this and would like for it to be reviewed.
...
4
votes
2answers
420 views
Team git commit cleaner
I cleaned a big repository for my team with this Python code. My goal was for every developer in my team to check if some bad email are in the commit, and replace the information by the good one. I ...
2
votes
0answers
81 views
Delegating which module's functions to use based on user input
My main concern with this code is this problem - given that this program could generate a prompt string from Bash, Zsh, Fish, etc., I would like to make this code easily extendable so people can add ...
5
votes
1answer
107 views
Bash script for Git & VSS interop
I have been slowly evolving some code for Git and VSS interop based on a quest I started a while ago
And the code is now working, some parts have been updated without test (such as the init) and I am ...
7
votes
1answer
97 views
Monkeypatching __builtin__ in tests for mocking
I'm testing a little magic behaviour of my script that automatically reads from ~/.ghtoken to do automagic authentication on GitHub API requests. I want to test ...
4
votes
1answer
184 views
Ruby script to create git repos
I wrote my first ruby script, by this tutorial. It creates a local and remote git repo.
I have been working for about 3 years with PHP, and somehow I find that my ruby script looks incredibly ugly.
...
2
votes
2answers
64 views
Small CLI note manager and publisher
This is my first attempt at trying to make a CLI note manager, than can be easily published on the web. I have made one note and you can see it live here.
I have added some comments, and placed the ...
3
votes
1answer
265 views
Bash script for tagging the current git workspace including uncommitted changes
I use the following script to autotag the current workspace while building even if there are changed (not committed) files:
...
10
votes
1answer
279 views
Git hook that checks out branch that was pushed to this repository
Description
If you install this hook in your repository and push branch foo-automerge to this repository, this hook will merge this branch into working copy if:
...
6
votes
1answer
392 views
Git commit-msg URL shortener
I have just written my first git hook script. It is very simple that simply finds any URLs in the commit message and uses the Google URL shortener to rewrite the URL nicely.
it is located here.
I ...
10
votes
3answers
2k views
Git pre-commit hook to check that changes to certain files only happen on the master branch
As a beginner in Ruby, I am trying to optimize this script that is a client side pre-commit hook for git.
Was hoping I could get a review to ensure I am following all ruby idioms, and to ensure I ...