Tag: bash

How to make quick backup of untracked files which I want to delete by git clean?

I have a lot of untracked files. I am pretty sure that most of them I can delete, however… you know, backup could be helpful 😉 What you are doing in similar situation?

How to run bash script after git push

I wanted to know how to execute a bash script in the local repo after pushing to github. The bash script is located in the root of the folder. It can be moved around depending on where it is being called I guess. I have looked into git hooks but there is no post-push hook […]

Use emacsclient -t when committing in Git

In my .bash_profile, I use this: export EDITOR=emacsclient alias e=’emacsclient -t’ When I commit changes with Git, it will open a new emacs window, but with emacs –daemon. How can I set my default Git editor to be emacs with the t flag enabled?

Show git branch and status in Mac Bash

I use the Github for windows client.The shell with powershell is very nice! How do I implement it on MAC? Not only the branch name,I also want git status

How do I exit my git commit message? I'm NOT in the VIM, I used the “ commit -m ” command

I was trying to commit a message and I accidentally made a typo: ‘git commit -m ‘Deleted old Basic Syntax chapter README’ Now i’m stuck in the terminal, and all it shows is: > > > > >asdfasdfad > >asd > How do I exit out of this, but still keep my commit message? I’m […]

Autocomplete git in mac OS not working?

I am using git in mac. I am trying to have the autocomplete feature. I followed these steps (http://www.codethatmatters.com/2010/01/git-autocomplete-in-mac-os-x/) but I get this error, any idea? : command not found –bash: /Users/me/git-completion.bash: line 80: syntax error near unex’ected token in -bash: /Users/me/git-completion.bash: line 80:case “$COMP_WORDBREAK’” in

Getting a list of all unversioned files in a Git-controlled folder

Getting a list of unversioned files in a Git-controlled folder is way more annoying than it needs to be. Unless I really suck at reading man pages, it doesn’t look like Git provides a facility to perform this operation on its own. There may be a more elegant way of performing this, but here’s a […]

how to escape special characters in .gitconfig proxy authentication

I’m trying to use git behind a proxy and i have set up the proxy details in the .gitconfig files as follows. [http] proxy = http://<username>:<password>@<proxy_ip>:<proxy_port> The problem is that the username and password field contain the ‘@’ character which needs to be escaped.How should it be escaped?

Git export files as zip/tar since specified commit till today

So I want to export all files starting from specific commit id till today (which may include subsequent commits), so I am doing this: git diff-tree -r –no-commit-id –name-only –diff-filter=ACMRT $commitId | xargs tar -rf output.tar However, it seems this outputs file only that were modified in specified commit id ($commitId). What I am looking […]

How do I pass an absolute path to the adb command via git bash for windows?

I’m trying to pass a unix style path to the Android adb command using a git bash (msysgit) but the shell is interpreting my path incorrectly. This is what I’ve tried so far: $ adb push myfile /mnt/sdcard/ failed to copy ‘myfile’ to ‘C:/Program Files (x86)/Git/mnt/sdcard/’: No such file or directory $ adb push myfile […]

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