by neolao
Éditer le fichier ~/.ssh/config
:
Host github-neolao
HostName github.com
User git
IdentityFile /home/neolao/.ssh/id_rsa
Host github-superman
HostName github.com
User git
IdentityFile /home/neolao/.ssh/superman-id_rsa
On peut ensuite cloner comme ça
git clone git@github-neolao:user/his_repo.git
git config user.name "neolao"
git config user.email "contact@neolao.com"
git --bare init
git fetch origin
git branch -a
git branch -r
git checkout test
git reset --hard
git reset --hard 115a127c72a7b77879ce47a1044ef39f51bb8682
git clean -f -d # remove untracked files
git checkout HEAD -- myFile.txt
git rebase origin/master
git merge 1.1
git checkout -b my_feature
git push origin origin:refs/heads/new_feature_name
git fetch origin
git branch -r
git checkout --track -b new_feature_name origin/new_feature_name
git pull
git branch -d myBranch
git push origin :myBranch
ou
git push origin --delete <branchName>
git push origin myBranch
git tag -a 1.1.0
git push origin master : 1.1.0
git tag -d 1.1.0
git push origin :refs/tags/1.1.0
git commit -a --date="Fri Apr 5 20:00 2013 +0100"
git push git.neolao.com feature/123:feature-123
git clone --bare /path/to/work /my/new/repository.git
Deuxième méthode, il faut copier le contenu du dossier @.git@ dans un nouveau, et indiquer ce c’est un dépôt.
cp -r /path/to/work/.git/* /my/new/repository.git/
cd /my/new/repository.git/
git config --bool core.bare true
git checkout --orphan gh-pages
git stash list
git stash drop stash@{2}
git rev-parse origin/1.1.x
git filter-branch --tree-filter 'rm -f vim.zip' HEAD
git config core.sshCommand 'ssh -i /home/me/.ssh/id_ed25519_special'
rm -fr .git
git init
git remote add origin [your-git-remote-url]
git fetch
git reset --mixed origin/master
git branch --set-upstream-to=origin/master master