hainm/notes

git

Opened this issue · 10 comments

hainm commented
  • git remote add pytraj_git https://github.com/pytraj/pytraj
hainm commented

add branch's name in terminal. (from Jason)

Solution:
Add this to .bashrc

parse_git_branch() {
     git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
hainm commented

Error: error: SSL certificate problem, verify that the CA cert is OK

Solution:
env GIT_SSL_NO_VERIFY=true git clone https://github.com/hainm/ParmEd

hainm commented

show un-track files in current folder with given pattern

git ls-files --other -x test*

modified files

git ls-files --modified | xargs add

show unmerged files

git diff --name-status --diff-filter=U

hainm commented

show unmerged files

git diff --name-status --diff-filter=U

hainm commented

fork from fork

Amber-MD/cpptraj#52 (comment)

from Jason's comment

git remote add drroe git@github.com:/drroe/cpptraj.git
Then fetch the information from his remote:

git fetch drroe
Then checkout whatever branch you want from Dan's repo:

git checkout frame_externalData
Or if that doesn't work (because your git is too old):

git checkout -b frame_externalData drroe/frame_externalData
hainm commented

undo merge conflict

git merge --abort

hainm commented
  • add subtree

git subtree add --squash --prefix=AmberTools/src/pytraj pytraj_github/master

  • pull to subtree but combining all the commits

git pull --squash -s recursive -X subtree=AmberTools/src/pytraj pytraj_github master

hainm commented

force to overwrite when pulling

http://stackoverflow.com/questions/9589814/git-force-a-pull-to-overwrite-everything-on-every-pull

git fetch origin master
git reset --hard FETCH_HEAD
git clean -df