Linux Git Commands
Push local modification to server
git add deep learning/paper/reinforcement
git commit -m "xxxxxx"
git push -u origin masterSolution to ERROR: “fatal: The remote end hung up unexpectedly
git config http.postBuffer 524288000
git config --global http.postBuffer 157286400Undo last two commits which not pushed yet(Caution: this will also delete relevant local files)
git reset --hard HEAD~2Undo commit, also roll-back codes to previous commit
git reset --hard commit_idUndo commit, but won’t undo local codes modification
Can re-commit local changes by “git commit”:
git reset commit_idOnly view how many non-pushed commits
git statusOnly view comments/descriptions of non-pushed commits
git cherry -vView detailed informations of non-pushed commits
git log master ^origin/masterFind id of last commit
git logClone a particular version of commit-id
After git clone the newest repo:
git checkout [commit-id]Convert that repo to my forked repo (stay tuned..)
Clone a specific Git branch
git clone -bExample:
git clone -b my-branch https://git@github.com/username/myproject.gitClone a Fast R-CNN COCO branch:
git clone --recursive -b coco https://github.com/rbgirshick/fast-rcnn.gitSave git username/password on Git for Windows
Create .git-credentials to save git username/password:
https://username:password@github.com git config --global credential.helper storeRe-run git bash.
One way to address SSL certificate problem
SSL certificate problem:
$ git clone https://github.com/BVLC/caffe.git
Cloning into 'caffe'...
fatal: unable to access 'https://github.com/BVLC/caffe.git/': SSL certificate problem: certificate is not yet validThe easiest way is to disable the SSL CERT verification:
git config --global http.sslVerify false
This will prevent CURL to verity the HTTPS certification.For one repository only:
git config http.sslVerify falseSoluton