Tag: bash

modifying working directory and staging area temporarily in git pre-commit hook

I’m using an an approach similar to this one to use a pre-commit hook to track changes to my database schema (as well as a few metadata-ish tables). I like to try to keep my commits clean so I want to be loudly warned in the commit message when there are automatic changes being staged/committed. […]

autopep8 in a git pre-commit — how to automatically recommit?

I have a git pre-commit hook that runs autopep8 on touch python files. My problem with it is that: # If there are whitespace errors,it printsthe offending file names and fails. (see below.) Question: How do I make it re-add and re-commit the files that I currently have to fix manually? Thanks! #!/bin/bash # # […]

Git GUI/TortoiseGit Not calling hooks that use powershell correctly? (Windows)

I’m seeing some strange stuff in how Git GUI and TortoiseGit call Git hooks. Given the following post-checkout hook, one would expect git to execute the powershell command and create the file: #!/bin/sh c:/windows/system32/WindowsPowerShell/v1.0/PowerShell.exe -Command “New-Item File.txt -type file” If I run this hook using the Git Bash, the file is created in my repository. […]

Git error 400 when doing push

When I do a git push I come up with this error: error: The requested URL returned error: 400 while accessing https://github.com/nathandunn97/SchoolAdvisor.git/info/refs?service=git-receive-pack fatal: HTTP request failed I am using Ubuntu 13.04 and my git version is

How can I make files which were created with git bash (touch file) visible in Windows 8.1?

I’ve got an interesting challenge. Making my first steps with Git Version Control on Windows 8.1 I set up a folder, added files and then followed a tutorial. Simple. After some time I noticed that Windows Explorer didn’t show me some of the files anymore (I think that was after using checkout but cannot confirm). […]

Why does ssh-agent need root access?

I’ve just installed Archbang, and am trying to clone a Git project of mine, which necessitates SSH keys. I’ve followed the Github guide to success in the past, on Ubuntu and RedHat boxes, but for some reason it’s not working out for me on my new Arch install. I’ve successfully generated my SSH public/private key […]

git on Windows: fatal: protocol error: bad line character: @-

I was using SourceTree + Git on Windows without any problem. I was able to use git commands from command (terminal/BASH). I prefer to use terminal for git push/pull etc. Unfortunately, after reinstallation of my machine (server/git are the same), I’m getting this painful error. On a new machine, I installed Git 1.9.5 (Git-1.9.5-preview20141217.exe) and […]

git-p4 message and author encoding

today i am in the position to migrate some pretty old perforce repositories to git. While this is realy interesting there is one thing that caught my eye. All special characters in the commit messages and even the author names are not in the correct encoding. So i tried to investigate where the problem comes […]

GitHub doesn't synchronize anymore

This is my first GitHub question so this might be pretty basic stuff and I’m sorry if it is repetitive or boring. I had GitHub installed on my system (W7) for quite a while. Everything worked fine until I got a new computer. All of our data from the Users/ directory is centrally stored so […]

Change mail address in each commit

This question already has an answer here: Change the author and committer name and e-mail of multiple commits in Git 28 answers

Git Baby is a git and github fan, let's start git clone.