So I have been having troubles pushing my most recent commits to a remote repository that I have set up on Bitbucket.
I am originally using Xcode, and have asked this question and was recommended to use terminal to push instead of Xcode.
Now, I tried terminal but that did not solve the problem. But it did give me a more detailed error message when I try git push
Neils-iMac:ProjectName Neil$ git push
Password:
Counting objects: 49, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (38/38), done.
Writing objects: 100% (39/39), 975.78 KiB, done.
Total 39 (delta 31), reused 0 (delta 0)
error: RPC failed; result=55, HTTP code = 0
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
fatal: expected ok/error, helper said '2004\??? ?&?ЇҶ-9?u?r?m?v?ǣ3Ƅ:??Eƒ?=?&?"d?+??
*^?eA??/3cv????ʞe??f???????
?(??`}D???5???^:T??PxP????%?338?]??F?}???Gf?g??[??*??}zƈ1X'
Neils-iMac:ProjectName Neil$
Neils-iMac:ProjectName Neil$
I am new to these remote repositories, and had everything working fine on Xcode, so if you recommend for me to do something in terminal it would help if you described how to do so.
See my previous question for a bit more detail.
EDIT: This is the result of;
git status:
# On branch master
# Your branch is ahead of 'origin/master' by 5 commits.
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# CrunchCalculator.xcodeproj/project.xcworkspace/
# CrunchCalculator.xcodeproj/xcuserdata/
nothing added to commit but untracked files present (use "git add" to track)
git remote show origin:
HEAD branch: master
Remote branch:
master tracked
Local branch configured for 'git pull':
master merges with remote master
Local ref configured for 'git push':
master pushes to master (fast-forwardable)
Looks like you are trying to push a large delta and your push buffer is not big enough
Try this:
git config http.postBuffer 524288000
I had the same problem and git config http.postBuffer 524288000 worked for me.
Related
I tried to push a project that I'd made locally to github and there was an error since I had created a repo on github with a license instead of leaving it empty. When I attempted to push the current local save to the remote repo, git bash would say there was nothing to commit, working tree clean even though the repo was empty save for the license and the local project was full of files.
I deleted the repo on github, but git bash still says (main) when I pull up the project. I normally start the repo on github and then git clone, and this is my first time trying to go the opposite way.
I deleted the original remote repo that the project was supposed to be for, and made a new one that is completely empty. I tried
git remote add origin git#github.com:manyLizards/node-tutorial.git;
error: remote origin already exists.
HP#DESKTOP-A0NOAM6 MINGW64 ~/SideProjects/node-tutorial (main)
$ git branch -M main
HP#DESKTOP-A0NOAM6 MINGW64 ~/SideProjects/node-tutorial (main)
$ git push -u origin main
Enter passphrase for key '/c/Users/HP/.ssh/id_ed25519':
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 16 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (5/5), 1.75 KiB | 1.75 MiB/s, done.
Total 5 (delta 0), reused 5 (delta 0), pack-reused 0
To github.com:manyLizards/node-tutorial.git
* [new branch] main -> main
branch 'main' set up to track 'origin/main'.
HP#DESKTOP-A0NOAM6 MINGW64 ~/SideProjects/node-tutorial (main)
$ git add -A
HP#DESKTOP-A0NOAM6 MINGW64 ~/SideProjects/node-tutorial (main)
$ git commit -m"initialized github repo"
On branch main
Your branch is up to date with 'origin/main'.
nothing to commit, working tree clean
HP#DESKTOP-A0NOAM6 MINGW64 ~/SideProjects/node-tutorial (main)
$ git push origin --delete main
Enter passphrase for key '/c/Users/HP/.ssh/id_ed25519':
To github.com:manyLizards/node-tutorial.git
! [remote rejected] main (refusing to delete the current branch: refs/heads/main)
error: failed to push some refs to 'github.com:manyLizards/node-tutorial.git'
HP#DESKTOP-A0NOAM6 MINGW64 ~/SideProjects/node-tutorial (main)
$ git branch --delete --remotes origin/branch-name
error: remote-tracking branch 'origin/branch-name' not found.
HP#DESKTOP-A0NOAM6 MINGW64 ~/SideProjects/node-tutorial (main)
$ git branch --delete --remotes origin/main
Deleted remote-tracking branch origin/main (was dba3d90).
HP#DESKTOP-A0NOAM6 MINGW64 ~/SideProjects/node-tutorial (main)
$ git fetch origin --prune
Enter passphrase for key '/c/Users/HP/.ssh/id_ed25519':
From github.com:manyLizards/node-tutorial
* [new branch] main -> origin/main`
I assume you don't need to make a copy of your remote since you already have deleted that. Run
git remote remove origin
which removes the origin, in your case main. Also, you can change the URLs in .git\config to set for new URLs without removing the remote repo.
see hobbs's answer
I am new to Git and Github; and I came across a problem. There is a similiar question here (git bash failed to load advapi32.dll), but they are experiencing a different problem and there are no answers either. I have searched online and was unable to fix this. Here is the issue:
I am using Git Bash to push/pull commits to Github. When I try to push my work, I get this error saying "failed to load advapi32.dll ". I do have this file in my registry. The full Git message is bellow. It is worth noting here, that despite this error, Git is uploading and downloading commits perfectly fine; I just want to fix this problem in case it causes more issues in the future.
$ git push origin master
failed to load advapi32.dll
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 418 bytes | 418.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
To https://github.com/khash021/reflections.git
98a7bd9..b982ba4 master -> master
Thanks,
Khash
This problem occurs because the credential halper has been set to wincred and you do not have wincred installed. To verify this, run the command
git config --global credential.helper
if the result says "wincred", this is your problem. To unset the credential helper, run the command:
git config --global --unset credential.helper
That should solve the problem.
First, check your Git version: if it was v2.16.1.windows.2, from 4 days ago, it was quite buggy.
Try with the one released today: v2.16.1.windows.3: uncompress PortableGit-2.16.1.3-64-bit.7z.exe anywhere you want, and define a simplified PATH for testing.
well you could adding the flag:
$ git push origin master --all
Also, given that the .dll file is a system file, check that git has the permission to access it.
So I'm just learning Git, and can't tell what I'm doing wrong in setting up a local and remote repo for my scripts. Originally, the remote repo was going to live on a fileshare (\server\share$\scripts), but I can't even seem to get this to work on my local machine.
I've done my research, and read up on some of the common pitfalls, but I still can't seem to get files accurately reflected in my remote repo when pushing from the local one.
What I have:
Local Repo: In C:\git, with one file "test.txt" created by:
cd C:\git
git init
echo "Hello World" > test.txt
git add .
git commit
Remote Repo: C:\test
git --bare init
Then, when I specify a remove branch with:
git remote add origin C:\test
git push origin master
It tells me all is fine:
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 315 bytes | 315.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To C:\test
06e076a..62b6130 master -> master
And further git pushes return "Everything up-to-date", but the files are never pushed to the remote repository. Querying the logfile indicates that the push did in fact take place:
commit 62b6130cedef529ef97aec5333fcbee96c5e9a2f (HEAD -> master)
Author: [Redacted]
Date: Wed Jan 24 15:21:37 2018 -0500
TEST COMMIT
So where are the files? I'm on the right branch (master), and I even ran a git config receive.denyCurrentBranch false because some other similar threads suggested this as a fix.
Looking for some guidance here, appreciate any and all help!
Your remote repository is a bare repository. This means there simply is no checked out working tree. Just the git objects and branches and tags.
Having a working tree (aka your files in the most up to date master branch) doesn't make any sense for a remote repository. This is where you store all versions of all your files in one place. How should git know which branch/version/commit to use in the working tree?
I also found this description: Source
git init is for working
git init --bare is for sharing
To get your files back again, you need to clone from there.
git clone C:\test .
This will create a new repository with working tree.
Here are some links:
What's the -practical- difference between a Bare and non-Bare repository?
http://bare-vs-nonbare.gitrecipes.de/
I created a new file in a local folder monitored by git. I then did
git add .
git commit -m "blah blah"
git push
but was rejected with
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
I tried git pull and got the error
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
which is a bit surprising considering there is only the master branch.
So I tried git pull origin master and something looking like VI with a bunch of empty lines opened up wanting me to resolve merge conflicts and it didn't give any information.
I just want to push changes to the repo. I'm the only one working on this personal project. I'm using Windows 10 and the official git bash. How do I git over this problem?
BUT WAIT!
I tried git pull origin master a second time and it worked! Nothing had been changed. This has happened before and I'd like to know why?
Here's the details:
first git pull origin master gave
* branch master -> FETCH_HEAD
second:
branch master -> FETCH_HEAD
Already up-to-date.
third:
remote: Resolving deltas: 100% (2/2), completed with 1 local objects.
no other commands were run in between. On the first one a bizarre VIM text editor opened up that wanted me to type something in.
remote: Resolving deltas: 100% (2/2), completed with 1 local objects.
Why am I unable to update my GitHub from my Mac?
git status produces the following:
On branch master Changes to be committed: (use "git reset HEAD
<file>..." to unstage)
new file: file.test
Untracked files: (use "git add <file>..." to include in what will be
committed)
.DS_Store
git push produces the following;
fatal: The current branch master has no upstream branch. To push the
current branch and set the remote as upstream, use
git push --set-upstream origin master
You need to git add ., then git commit -m "My commit message", then git push -u origin master.
That will set the upstream to the origin/master. Moving forward, just git push shall suffice
Git works through commits - which are basically snapshots of what your repository looked like at a given point in time. You need to commit the files to your repository before you can actually push them to GitHub.
So your first step is to add the files to the "Staging Area" with
git add file.text # you can do git add . but this will add all files which you may not always want
Now you can check the current status of the "Staging Area" with
git status
This will let you make sure that you are only committing the changes that you want added.
Now you can commit the changes. Committing will only 'save' the files that are in the Staging Area.
git commit -m "A useful description of what you did since your last commit"
Ok so now you're ready to push. Assuming you cloned from GitHub you can just run
git push origin master
But if you created this repository with git init you will need to tell git that you have a remote repository somewhere. Do this by running
git remote add https://github.com/<usernane>/<repo_name> origin
This origin is the name you would like to associate with the remote repository. 'Origin" is the most common but you may have other remotes like "backup" or "code_review" for different use cases.
Once you have added the remote repo, you can actually push to it with
git push origin master
Again, origin is the name for your remote repo and 'master' is a 'branch' name.
You can add the -u flag which will make it so that git assumes you want to push to origin. So in the future you would only need to run
git push
Listen to the error messages. :)
You currently have one untracked file, .DS_Store which I happen to know is a system file, so you may want to add that to your .gitignore
As for trying to push upstream, you need to set your upstream for each branch, so you simply need to type the command
$ git push --set-upstream origin master
then do a simple
$ git push
to send your changes to github.
If the branch you are pushing to online is ahead of you, then you may need to do a git pull to get grab the changes, before you do a git push.