Please! I lost all my day's work.
I created a github repository... I've been working all day doing git add -A and commit but I never did a push. I changed a readme directly on the page (not knowing I was going to have problems to merge those same branches).
When I tried to make git push after all day's rok the following happened:
To https://github.com/NEGU93/Steganography.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/NEGU93/Steganography.git'
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.
So I tried ta git pull --rebase but it started crashing some things I don't know what it is:
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
From https://github.com/NEGU93/Steganography
6161279..44d1f0f master -> origin/master
0 [main] expr 8516 open_stackdumpfile: Dumping stack trace to expr.exe.stackdump
0 [main] cat 15632 open_stackdumpfile: Dumping stack trace to cat.exe.stackdump
0 [main] rm 4660 open_stackdumpfile: Dumping stack trace to rm.exe.stackdump
^C
I put ctrl+C to stop the crashin there. So I made a git fetch and then a git push of my work:
fatal: You are not currently on a branch.
To push the history leading to the current (detached HEAD)
state now, use
git push origin HEAD:<name-of-remote-branch>
So I did as suggested and made a git push to master:
git push origin HEAD:master
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 1.49 KiB | 0 bytes/s, done.
Total 5 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), done.
To https://github.com/NEGU93/Steganography.git
44d1f0f..c3b8393 HEAD -> master
But now when I got back the work was not there... Help! I don't know what to do and I'm starting to panic. I think the problem is with git fetch. Is there a way to get all my work back???
Use git reflog to see past commits, then use the commit's hash to reset hard e.g.:
git reset --hard e870e41
See How can I recover a lost commit in Git?
Related
I have deployed the code once on github using github pages and now i have maked the changes in some of the code and now i am not able to push the code .I deleted the all branches and code on repo and did the process once again but still on live website i am not getting any changes .
PS D:\VJTI_Racing_Website_2.0\frontend> git add .
>> git commit -m "updated"
>> git push origin master
On branch gh-pages
nothing to commit, working tree clean
Enumerating objects: 26890, done.
Counting objects: 100% (26890/26890), done.
Delta compression using up to 8 threads
Compressing objects: 100% (21199/21199), done.
Writing objects: 100% (26890/26890), 779.96 MiB | 1.96 MiB/s, done.
Total 26890 (delta 4725), reused 26890 (delta 4725), pack-reused 0
remote: Resolving deltas: 100% (4725/4725), done.
remote: warning: File node_modules/.cache/default-development/3.pack is 52.95 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: error: Trace: d119776a9de8bb6b95dccf52e4031387455d238a7a7367d558a094750a2328de
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File node_modules/.cache/default-development/0.pack is 490.10 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
To https://github.com/vjtiracing/VJTI_Racing_Website_2.0.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/vjtiracing/VJTI_Racing_Website_2.0.git'
the error showing is of large file but I deleted the node modules file and also cleared the cache please someone help me out here.
I have a folder with codes, i pushed it on github after creating a repository but the process was successful but i can not see any file in the repository, any help guys, this is my cli codes
SydoTech#DESKTOP-PUHK97G MINGW64 /d/james/ict-specialists (master)
$ git remote add origin https://github.com/Kato669/ict-specialist-website.git
SydoTech#DESKTOP-PUHK97G MINGW64 /d/james/ict-specialists (master)
$ git push origin main
error: src refspec main does not match any
error: failed to push some refs to 'https://github.com/Kato669/ict-specialist-website.git'
SydoTech#DESKTOP-PUHK97G MINGW64 /d/james/ict-specialists (master)
$ git push origin master
Enumerating objects: 1383, done.
Counting objects: 100% (1383/1383), done.
Delta compression using up to 4 threads
Compressing objects: 100% (1380/1380), done.
error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8)
send-pack: unexpected disconnect while reading sideband packet
Writing objects: 100% (1383/1383), 35.93 MiB | 323.00 KiB/s, done.
Total 1383 (delta 181), reused 0 (delta 0), pack-reused 0
fatal: the remote end hung up unexpectedly
Everything up-to-date
SydoTech#DESKTOP-PUHK97G MINGW64 /d/james/ict-specialists (master)
$
I have an old repository on Github (the last commit was 2 years ago). Recently I worked with the local copy, and performed several commits, tried to push, it gave me the following error
$git push
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
I searched for a solution here , I tried $ git push --set-upstream origin masterthe following errors occurred:
Enumerating objects: 182, done.
Counting objects: 100% (182/182), done.
Delta compression using up to 8 threads
Compressing objects: 100% (110/110), done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
send-pack: unexpected disconnect while reading sideband packet
Writing objects: 100% (166/166), 2.44 GiB | 599.00 KiB/s, done.
Total 166 (delta 61), reused 147 (delta 47), pack-reused 0
fatal: the remote end hung up unexpectedly
Everything up-to-date
I tried another solution from the same post $ git push -u origin head
it gives me some extra errors
git push -u origin master
Warning: Permanently added the RSA host key for IP address '140.82.112.4' to the list of known hosts.
Enumerating objects: 182, done.
Counting objects: 100% (182/182), done.
Delta compression using up to 8 threads
Compressing objects: 100% (110/110), done.
remote: fatal: pack exceeds maximum allowed size
fatal: sha1 file '<stdout>' write error: Broken pipeB/s
error: remote unpack failed: index-pack abnormal exit
To github.com:drnesr/PrayerTimesStudies.git
! [remote rejected] master -> master (failed)
error: failed to push some refs to 'github.com:AcountName/RepoName.git'
How can I solve this push to GitHub problem?
I thought this would be really easy, but I'm failing to clone http://github.com/jacksonh/manos so I can build the project.
[dev#vps ~]$ git clone http://github.com/jacksonh/manos
Initialized empty Git repository in /home/dev/manos/.git/
The above never returns and never creates any directories. I can browse the source using the http address, but I'm not sure how to get the git cloned?
This should work for you.
git clone https://github.com/jacksonh/manos.git
It did for me:
$ git clone https://github.com/jacksonh/manos.git
Cloning into 'manos'...
remote: Reusing existing pack: 9805, done.
remote: Counting objects: 34, done.
remote: Compressing objects: 100% (34/34), done.
remote: Total 9839 (delta 8), reused 10 (delta 0)
Receiving objects: 100% (9839/9839), 5.28 MiB | 1.99 MiB/s, done.
Resolving deltas: 100% (5128/5128), done.
Checking connectivity... done.
I have enabled history for xcdatamodel file.From the xcode it appears to be one file
from terminal its a set of folders
my.xcdatamodeld/
my 2.xcdatamodel
my.xcdatamodel
I am unable to deliver this to my remote git repository due to this error
indmacsunelama$ git push
Counting objects: 19, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (13/13), done.
Writing objects: 100% (14/14), 34.11 KiB, done.
Total 14 (delta 5), reused 7 (delta 1)
remote: usage: git cat-file (-t|-s|-e|-p|<type>|--textconv) <object>
remote: or: git cat-file (--batch|--batch-check) < <list_of_objects>
remote: <type> can be one of: blob, tree, commit, tag
remote: -t show object type
remote: -s show object size
remote: -e exit with zero when there's no error
remote: -p pretty-print object's content
remote: --textconv for blob objects, run textconv on object's content
remote: --batch show info and content of object standard input
remote: --batch-check show info about objects fed from the standard input
remote: error: hook declined to update refs/heads/master
To git://mylinuxbox.us.spec.com/mobile.git
! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'git://mylinuxbox.us.spec.com/mobile.git'
Those errors indicate that you have a buggy hook installed in your remote repository. Check the hooks subdirectory in mobile.git on your remote server and look at the hooks that are enabled. It seems that the hook is misusing git cat-file at some point.