Gitlab error: failed to push some refs to - terminal

Initially, I had a large folder that was failing to push onto gitlab. I then separated the contents of that large folder into two separate folders.
The first folder successfully pushed but I receive the error below when I try to push the second folder.
Now that I am trying to push the remaining files but receive:
"error: failed to push some refs to '...'
"hint: Updates were rejected because the remote contains work that you do not have locally"
Is this occurring because the second folder is missing the contents in the first folder? What do I do to resolve this? I must upload my second folder.
Help!

Sounds like your second folder is not up to date relative to the remote. You can update by using git fetch and git merge; or git pull.

Related

fatal: repository 'https://git.heroku.com/vast-basin-36215.git/' not found

I actually deleted the app named vast-basin-36215 on the Heroku dashboard, I'm trying to deploy my project on another app I just made, which has a different name. I did that command by replacing the name of the old app with the new one but I got the following:
remote:! No such app as vast-basin-36215.
fatal: repository 'https://git.heroku.com/vast-basin-36215.git/' not found
vew error image
according to the error image log you provided, you missed some important messages. when you did:
git add .
you got response
....
"nothing to commit."
that means that after the first command heroku create you should have CD to the new repository folder and only then continue with the flow
heroku create barishal-gadget-store
CD barishal-gadget-store
git add .
...
...

Git Push is working via Terminal but not via Xcode

I've created a remote git repository on my local computer inside Google Drive folder
git init --bare project.git
and added the remote path as follows
git remote add origin '~/Google Drive/git/project.git'
When I commit via Xcode, it rightly shows the push option check box with correct branch (master in this case). I marked it checked and then press 'Commit and Push' and apparently it does so but actually not pushing to remote repository. When I push from 'Source Control -> Push', it shows successful message but my remote repository doesn't get updated.
When I run the push command from terminal then it does update the remote repository successfully.
git push origin master
How to fix so that Xcode (7.1.1) can push successfully?
Edited: A side note, this has troubled me a lot by the time I realized this. As initially, I think it was working via Xcode (maybe some prior version to 7) as well.
Edited: #VonC here is how I know how git push is working. The modified date gets changed for some objects in finder.
Edited: As per instruction by #VonC, now the push is working from Xcode when project.git is moved at different location out of 'Google Drive' folder. But, I want it to work with 'Google Drive' folder.
Edited: I further moved the project.git to a folder with name including space and again xcode is not pushing but terminal is still pushing.
Xcode 7.1 doesn't push to remote repo path with a space but Terminal does provided that the path is enclosed in quotes. Hope Apple would fix it for new releases.
I've got my issue fixed by renaming the 'Goolge Drive' to 'GoogleDrive' and adjusted the remote path accordingly. Google Drive App prompted for missing folder and I pointed it to the renamed one.
my remote repository doesn't get updated.
Try simply to clone that repo repo elsewhere to see if you get back the content you just pushed:
git clone ~/Google Drive/git/project.git /somewhere/else
Don't forget that a bare repo has no working tree, so after a push, you don't see any new file.
Note: if a remote repo path with a space is problematic to XCode, a possible workaround would be to push to a path without path:
either one which is a symlink to Google Drive
or a path which is rsync'ed after to Google Drive

TortoiseGit Error - Could not get all refs. libgit2 returned: corrupted loose reference file

I just got an error after a recent commit using Tortoise Git:
"Could not get all refs. libgit2 returned: corrupted loose reference
file"
which pops up when I go to check the Log.
Any ideas on how to rectify this?
Your refs are stored inside the raw repository (in .git) in directories (named for each branch) under the "refs" directory. The problem is that one of these files has been corrupted. If you check the code here you'll see that the problem is either that the ref file is less than 40 bytes long, or has a 41st byte that is not a space (or tab, newline, etc). Search through the files in the .git/refs directory and you'll find the bad one. It should contain the 40-character hash of the commit which that branch refers to. You can safely fix it using Notepad.
In my case it was the use of "junction tool" (sysinternals). Got that error only when adding new sub directory and files. Using git bash the problem does not occur. Everything else works fine with "junction tool" and TortoiseGit ...
I had the exact same error and managed to get my repo back without losing my changes.
I:
Made several backups of the corrupt git repository just in case
Cloned the lasted pushed version from the remote repository
Copied all the files from the corrupt .git folder EXCEPT all files related to HEAD, FETCH_HEAD, ORG_HEAD etc ... the most important are the refs, obj, and index
Ended up with a valid history, but corrupt index, applied the solution from this post How to resolve "Error: bad index – Fatal: index file corrupt" when using Git
And my repository was back working ...
To make sure I did not push anything wrong, I cloned again from the remote, checked-out the changes I wanted to save from the restored repository, and comited them fresh.

GIT_DISCOVERY_ACROSS_FILESYSTEM error

Recently I started getting this error everytime I commit to my local Xcode git.
fatal: Not a git repository (or any parent up to mount point /Volumes/xxx)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
I have partitioned my HDD into 2 drives and my source code is on one of them. All my source is local and I'm just using the built in Git with Xcode. Any clues why I get this error?
Check this. You must be missing git init. This is the first command to start with. This command creates an empty Git repository - basically a .git directory

Cannot clone GIT repository on network drive

Using Windows 7, we have a bare GIT repository set up on a network drive so that multiple users can pull/push from it. I am able to create a new working repo on my local and multiple other networked drives. However, when I try to clone a new working repository on the same network drive (different folder) , it fails.
Using TortoiseGIT, after I right-click and choose "GIT Clone", put in all of the necessary paths to my bare repo (the new working repo is already filled in) and hit ok, I get the following error:
Cloning into 'R:\path\to\new\repo'... done.
error: refs/remotes/origin/master does not point to a valid object!
error: Trying to write ref refs/heads/master with nonexistent object 5d2164db2c61efc7a5598f6ff75ed3fbbb12456e
fatal: Cannot update the ref 'HEAD'.
fatal: The remote end hung up unexpectedly git did not exit cleanly (exit code 128)
and it fails to create the repo. It does however build the new folder & ".git" subfolder structure.
It's not a r/w permissions issue because I can r/w any other files, but just cannot seem to create this newly cloned repo. My co-worker cannot either. Even if I got to another folder on the network drive, I still cannot clone the repo successfully. Surprisingly, if I just copy/paste a repo I created in another location, then manually do a "pull", it works and updates successfully.
Any ideas on what to try next? Obviously I've Googled "exit code 128" and "cannot update the ref 'HEAD'" but cannot find a solution to my issue. It's probably something really simple that we are overlooking, but we're just getting started with GIT and this is really causing us headaches...
UPDATE: I just noticed that when I do a manual pull from GIT to my "copy", it is doing a Fast-Forward. Maybe this provides some additional clues?
From R:/path/to/repo
* branch master -> FETCH_HEAD
Updating 5d2164d..d75bdb7
Fast-forward
Files.py | 3 +++
1 file changed, 3 insertions(+)
Success
Git might be trying to do some smart stuff with hardlinks that fails on the network drive. Try using git clone --no-hardlinks /r/path/to/my/repo or git clone file:///r/path/to/my/repo
Please do this via command line in msysgit
git clone /r/path/to/my/repo /r/some/other/path
Further, I would recommend using git from the command line as it is a tool that was designed to be used from the command line. You will be able to find more help, faster, with any issues that come up for you.

Resources