Background
- I created a bare Git repository in my USB stick on GUI.
- I pushed some Git commits to the bare repository in the USB.
The commands for the above steps shouldn’t be difficult. In step 2,
if one sets the upstream repository to the bare repository in the USB,
the command to be issued is even easier: just git push
will do, and
the remote and branch names can be omitted.
Problem
I worked on Linux text mode instead of GUI. After committing the
changes, I tried pushing them into the bare Git repository in the USB.
[owner@localhost ~/MATH2220]$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working directory clean
[owner@localhost ~/MATH2220]$ sudo mount -t vfat /dev/sdf1 \
> /media/owner/08F1-B181/
[owner@localhost ~/MATH2220]$ git push
Counting objects: 4, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 551 bytes | 0 bytes/s, done.
Total 4 (delta 1), reused 0 (delta 0)
remote: error: insufficient permission for adding an object to repository databa
se objects
remote: fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To /media/owner/08F1-B181/MATH2220/MATH2220.git
! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to '/media/owner/08F1-B181/MATH2220/MATH2220.git
'
How can I push commits into the USB?