resubmitting the same files to remote branch
I am working on a project of my university.
I have already submitted the corrupted files of project (degrees.py
, small.csv
... etc) to remote branch 1
, which is protected branch (could not use force push) of **GitHub repository
, and now I want to resubmit the updated same files of project (degrees.py
, small.csv
... etc) again to branch 1.
I am not able to resubmit the updated same files to my branch 1.
i am using git fetech
and git checkout
commands, I am trying to do
git init
git remote add origing <origin>
git fetch origin
#create branch branch1 locally switch to branch1 and copy from origin/branch1
git checkout -b branch1 origin/branch1
git add --all
git commit -m "comments"
git push
That is:
dir
__pycache__ degrees.py large small util.py
Sbariz@Sbariz-PC MINGW64 ~/desktop/cs50ai_search/s_degrees
$ git init
Initialized empty Git repository in C:/Users/Sbariz/Desktop/CS50ai_search/s_degrees/.git/
Sbariz@Sbariz-PC MINGW64 ~/desktop/cs50ai_search/s_degrees (master)
git remote add origin https://github.com/me50/shjee1063.git
Sbariz@Sbariz-PC MINGW64 ~/desktop/cs50ai_search/s_degrees (master)
git fetch origin**
remote: Enumerating objects: 29, done.
remote: Counting objects: 100% (29/29), done.
remote: Compressing objects: 100% (25/25), done.
remote: Total 29 (delta 1), reused 26 (delta 1), pack-reused 0
Unpacking objects: 100% (29/29), 21.60 MiB | 1.56 MiB/s, done.
From https://github.com/me50/shjee1063
* [new branch] ai50/projects/2020/x/degrees -> origin/ai50/projects/2020/x/degrees
* [new branch] ai50/projects/2020/x/tictactoe -> origin/ai50/projects/2020/x/tictactoe
* [new branch] main -> origin/main
Sbariz@Sbariz-PC MINGW64 ~/desktop/cs50ai_search/s_degrees (master)
$ git branch -a
remotes/origin/ai50/projects/2020/x/degrees
remotes/origin/ai50/projects/2020/x/tictactoe
remotes/origin/main
Sbariz@Sbariz-PC MINGW64 ~/desktop/cs50ai_search/s_degrees (master)
$ git checkout -b ai50/projects/2020/x/degrees origin/ai50/projects/2020/x/degrees**
error: The following untracked working tree files would be overwritten by checkout:
__pycache__/degrees.cpython-37.pyc
__pycache__/util.cpython-37.pyc
degrees.py
large/movies.csv
large/people.csv
large/stars.csv
small/movies.csv
small/people.csv
small/stars.csv
util.py
Please move or remove them before you switch branches.
Aborting