Tag: linux

Git – fatal: Could not get current working directory?

When I git clone from a repo, I get, fatal: Could not get current working directory: No such file or directory What do I do? I have checked the server and found that .git file exists. The server is running a Gitlab instance. I have configured ssh properly with the keys, and I’ve been committing […]

Why does Git convert CRLF to LF on Linux?

I have some shell scripts that need to have LF line endings (I’m on Ubuntu 14.04). Since this is a cross-platform open source project, a .gitattributes file is used to make line endings work ‘automatically’. Unfortunately, they don’t. $ cat .gitattributes # automatically normalize line endings * text=auto I have the following file on my […]

git changes not reflected on remote repository

Ok, I configured a bare git for me and another person to use for a project. We have the git set up on a linux computer and it seems to have worked ok. He added a text file to the git on the linux computer. Then he cloned from his local machine over ssh and […]

Using 'git remote add origin' creates a global remote instead of one local to current directory/repo

Solution: Finally realized the problem. Stupid User Error. Forgot to run ‘git init‘ in the new project directory first. Hence, running ‘git add .‘, ‘git remote add origin repo.git‘ (or even the typo ‘git add origin repo.git‘) in a directory without a git repo, will revert to applying the command globally, hence all the parent […]

How to treat a local dotfile repository?

As many others, I want to have a git repository with my configuration files and also upload a backup of it to a hosting site. My question is how to treat the dotfiles of the local repo. Let’s say that I have my zshrc/bashrc in the dotfiles repo. I can put the line ‘source /path/to/local/repo/zshrc’ […]

GIT signed tags and passphrase

how can i make git auto enter my passphrase when i signed tags. is there an option like — passphrase “my long passphrase”, i did try using ssh-keygen but it did not help. the Repository is on local and everything is done locally.

Create a git repo using an alias from terminal

Hey there I want to create a git repository like this: curl -u ‘USER’ https://api.github.com/user/repos -d ‘{“name”:”REPO”}’ But I want to do it using a alias in terminal (Ubuntu), like alias newRepo = curl -u ‘USER’ https://api.github.com/user/repos -d ‘{“name”:”$1″}’; git remote add origin git@github.com:USER/$1.git; So after in the terminal I type: newRepo test And it […]

How do I get the effect of GNU tar's –strip-components with git-archive?

In broad terms, what I’d like is a direct tar-to-tar transformation where the result’s root contains only a particular directory-subtree of the original. To illustrate with an example, say I want only the gitweb directory from git’s repository. Running $ git archive –prefix=git-gitweb/ master gitweb | tar tf – gives git-gitweb/ git-gitweb/gitweb/ git-gitweb/gitweb/INSTALL git-gitweb/gitweb/Makefile git-gitweb/gitweb/README […]

Script for root to git pull as another user

I have a script that I would like to have do a git pull inside another user’s git directory. This script is run by the root user. For example: cd /home/username/GitProject sudo -u username -i git pull When I run this, I get: fatal: Not a git repository (or any of the parent directories): .git […]

Why git is too slow to push large files? Is there any way then to optimize it or ignore it?

I have many large files under project/public/deploy/. All the rest is my source codes. When i pushed yesterday, still today its not complete yet, and my network is dead slow for this. I understand its because i have largest files and getting pushed, which is like impossible. How can i tell git push do not […]

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