Undo git push

Computer/linux 2017.10.22 07:01

Sometime, I would like to remove what I push into the git branch, in that case, the following two steps can give me a way to do so..


1) check the hash if you want to revert....

2) git push -f origin hash_id_if_you_want_to_rever:branch_name



저작자 표시 비영리 변경 금지
신고

'Computer > linux' 카테고리의 다른 글

Undo git push  (0) 2017.10.22
Combine multiple PDF files to a pdf file  (0) 2017.08.28
how to acceess udev rule parameter  (0) 2017.08.25
How to get only the mac address (Linux)  (0) 2017.08.25
posted by citadel
git
  • modify .gitmodule to change the new url in .gitmodules

    [submodule "epics-modules/mrfioc2"]
        url = https://github.com/epics-modules/mrfioc2
  • run git submodule sync


저작자 표시 비영리 변경 금지
신고
posted by citadel

The original repository :  https://github.com/EuropeanSpallationSource/snmp-nscl

The new repository : https://github.com/ESSICS/snmp-nscl


The original repository should have only one master, the new repository should be created via "github".




$git clone https://github.com/EuropeanSpallationSource/snmp-nscl
$cd snmp-nscl/
$git fetch origin
$ git remote add new-origin https://github.com/ESSICS/snmp-nscl
$ git push --all new-origin
$ git push --tags new-origin
$ git remote rm origin
$ git remote rename new-origin origin
$ git push --set-upstream origin master


The original repository could be deleted later.


If an original repository has branches, it would be better to check the following original reference.


https://www.smashingmagazine.com/2014/05/moving-git-repository-new-server/

저작자 표시 비영리 변경 금지
신고
posted by citadel
git