-
check all the branches :
git branch -a
-
get all the branches of one repo on a local machine :
git checkout remotes/origin/issue9_clang_format
git checkout issue9_clang_format (or git switch)
- create new branch from some branch : get on branch1 then
git checkout -b subbranch_of_b1 branch1
- push your new branch on github :
git add *
git commit -m 'comment'
git push --set-upstream origin subbranch_of_b1
- update a branch from another : checkout on the destination branch and
git merge origin-branch
git rm --cached eORCA05/BUILD/HGR/mkbathy05
git commit --amend -C HEAD
git push ...
git rev-parse --short HEAD
- get commit hash
- git reset --hard hashcommit
- git push --force origin master
- Add a SSH key and replace in .git/config
https://github.com
byssh://[email protected]
https://fabienmaussion.info/git-jekyll-ws
My template : https://github.com/alshedivat/al-folio
https://jekyllrb.com/docs/installation/macos/ gem install jekyll bundler
- generate two ssh keys associated with the two emails :
ssh-keygen -t rsa -C "[email protected]"
ssh-add ~/.ssh/id_auraoupa
ssh-keygen -t rsa -C "[email protected]"
ssh-add ~/.ssh/id_aureliealbertmeom
and add them to the adequate github account
- separate git repo in two directories :
mkdir ~/Work/git/auraoupa ~/Work/git/aureliealbertmeom
- set up a .gitconfig file in each directories and a general one that redirects to the relevant one :
general :
[includeIf "gitdir:~/Work/git/auraoupa"]
path = ~/Work/git/auraoupa/.gitconfig
[includeIf "gitdir:~/Work/git/aureliealbertmeom"]
path = ~/Work/git/aureliealbertmeom/.gitconfig
specific :
[user]
name = auraoupa
email = [email protected]