Tag: repository

Add a removed existing remote to a git repository

I accidentally performed a git remote rm <remote_repo_name> 🙁 Will a git remote add remote_repo_name <remote_repo_path> add it back as a remote even though the remote already had previously pushed content ?

how can I create a remote git repository that accepts pushes into the working tree?

Im trying to have a shared remote repository where team members can push their changes and see them live in a staging environment. Ive looked some options but I’m still stuck. Bare repositories have no working tree, and ive tried a normal repository with receive.denyCurrentBranch set to false, (which lets me push to the remote) […]

How to reduce repository size without loosing history of source code files?

The git repository of my current project, containing source code and image files, measures around 1.2 gigabytes. But the the actual files of all branches are only around 205 megabytes in size. I am a beginner with git and I guess that the huge repository size is caused by moving the image files around in […]

Changing the default directory for git repositories

Is it possible to change the default/root directory of where git looks for projects so you can clone a project like this: git clone git@myserver.com:project.git rather than like this: git clone git@myserver.com:/var/www/html/project.git I’ve seen git –git-dir=<path> in the help page but it seems that it only takes effect for that particular command rather than being […]

Git – Bare Repository is not up to date

ok I try again to describe my problem. At first let me say I am a beginner in Git. I have read a lot of stuff but there some points that are not clear for me. I work local on a workingcopy. My head on local branchx have the same id as remote branchx on […]

GitHub shows directories twice that have been renamed

I have a git repository that had a directory called Code. We wanted to remove the capitalization and change the directory name to code. We made that change locally and pushed it to the repo. Now on GitHub, it appears that the repository has two copies of the directory, one with each capitalization. When you […]

How can I clone a local git repo to github?

I have a few git repos on a local server and I want to synchronise them with Github for remote access. How do I clone these local repos to Github? After this, is it just a case of assigning the github repo as a remote of the local server repo?

git rebase to remove a commit

I have the following change history in my git repository: —X—Y—Z—A—B—C I began working from a base of code Z and made three changes A, B and C. Each of these changes has been uploaded as separate reviews on Gerrit and each depends on the change before it. Following a review I want to remove […]

GitHub recover deleted blocks of code

I am working on a project and we have a file where a few blocks of code that go together were deleted at different intervals a few commits back. I need to recover only some of these blocks and put them into something else I’m making. Is there a way to see the old blocks […]

Git push trying to push to different branch even though tracked

I’ve got a git repo setup with 4 branches: master dev johndev angular-routing I’m currently working on angular-routing and tried pushing to origin/angular-routing with simply git push which worked, but I noticed that I got the following error: ! [rejected] johndev -> johndev (non-fast-forward) I get what the error means, that’s fine, but I don’t […]

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