Tag: bash

Keep being prompted to enter passphrase for .ssh/id_rsa

I followed the tutorial here to set up ssh for github in cygwin on Window 7. However, every time I do git push origin master, I keep being prompted the following: Enter passphrase for /cygdrive/c/Users/mynameis/.ssh/id_rsa: This is so annoying because it beats the purpose of setting up ssh in the first place. I don’t understand […]

How to set aliasses in the Git Bash for Windows?

How to alias command in Git Bash for Windows downloaded from git-scm.com ? I mean Bash commands not Git. (windows7) edit writing aliases in .bashrc. file (as suggested by @gturri) not adding it in console.(after system reboot)(I have never wrote alias for ls command so it should be some default alias.)

Git clone from bash script

I am trying to automate my interactions with Git building a script and I am having the following problem. This works from the command line: git clone git@github.xxxx.com:blablabla/reponame.git /Users/myname/dev/myfolder And now I would like to do the same, but from my script. I have the following: #/bin/bash repository=”git@github.xxxx.com:blablabla/reponame.git” localFolder=”/Users/myname/dev/myfolder” git clone $repository” “$localFolder that gives […]

How to git clone dotfiles into my home directory with one command?

When you do a typical “git clone https://github.com/foo/bar.git” you get a folder in the current directory with all the files found in that directory. What I’m looking for is an optional command line arg that lets you drop all the files from that git repo (including the .git itself) in the directory you issue the […]

bash file returns unexpected token `$'do\r''

I found this script online and tried to use it: #!/bin/sh # Target directory TARGET=$3 echo “Copying to $TARGET” for i in $(git diff –name-only $1 $2) do # First create the target directory, if it doesn’t exist. mkdir -p “$TARGET/$(dirname $i)” # Then copy over the file. cp “$i” “$TARGET/$i” done echo “Done”; I’ve […]

In Git how can I stage a file I have just diffed without manually specifying the file?

I frequently diff a file, decide it’s what I’ll stage and then have to run the git add /long/path/to/file to manually specify the file. A usual work flow would go along the lines of: git status “oooh changes” git diff /long/path/to/changed/file “Yup, I remember that – commit time!” git add /long/path/to/changed/file Obviously this isn’t the […]

What is the difference between –parameter and -parameter?

I used git for some time now, but mostly I preferred the integration with Intelij IDEA. Now, in order to extend my knowledge and understanding of the system I decided to use the command line more. What I observed is that there are two types of parameters: –parameter and -parameter for example: git commit –amend […]

Bash shell script error sh: '

Aim: I’m trying to create a useful shortcut for initializing a git repo locally, and simultaneously creating a remote repo origin on bitbucket or github. This function is added to my .bashrc file in my home directory. Here is the bash function (which yields an error): function initg() { # Defaults to bitbucket API local […]

Truly Portable Git

I’m trying to create a fully portable version of git on a USB drive with it’s own SSH keys and I want it to work regardless of the drive letter windows gives it. I’ve installed portable git and most of it works. The problem I have is setting the $HOME to be dynamic I want […]

Tracking work hours through git

I recently finished a project that involved me working variable hours in one sitting. For example, I might start at 8AM and go till 2:30 PM. I would make a commit as soon as I started, and commit right before I left. I want to approximate how many hours I have worked on this project. […]

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