VSCODE plugin : GIT GRAPH
Historique git
git log
Git log --oneline
Git reset --hard hash_commit
git checkout HEAD -- /directory/my-file.txt
Git push -f
git checkout -b <new-branch-name> # create a new branch
git switch <branch-name> # Switch branch
git push --set-upstream origin <develop>
git branch -a
git reflog
git log --reflog
git reset --hard HEAD (going back to HEAD)
git reset --hard HEAD^ (going back to the commit before HEAD)
git reset --hard HEAD~1 (equivalent to "^")
touch .gitignore
rm -rf UE_mocap.git/
man rm
scp -r dossierSource etudiants@193.54.159.122:/home/etudiants/21groupe2
git stash save "Stash message for reference" #To add changes to stash stack
git stash list #Shows all the stashed change list
git stash clear #clears stash list
To apply the stash changes :
a) git stash apply stash @{n}
you can reapply the changes to your working copy and keep them in your stash with git stash apply
b) git stash pop stash@{n}
-> Popping your stash removes the changes from your stash and reapplies them to your working copy
n - stash number to be applied #Applying stash changes
git stash -u -u optiontells git stash to also stash your untracked files
git stash drop stash@{1}
git add . --all
git commit --fixup <id_hash>
git rebase -i --autosquash <id_hash_more_old>
git push --force origin <branch_to_push>
Lors du rebase le fixup va s'automatiquement se merger.
how to know the hash :
git rev-parse origin/master
revert the file
git checkout c5f567 -- file1/to/restore file2/to/restore
revert a directory
git checkout .\tdhoudini\hda\UNIT_import.hda\
git rebase --interactive 7efe9dde16d79ea2c80aaa22a2e4c7e985ed65f8 --autosquash
git commit --fixup hash
git reset --soft hash
# N: number of comits to rebase
git rebase -i HEAD~N
git fetch origin master:master
no fast forwad
git merge fixy_vdb_fur --no-ff
git tag "1.8.0"
git push origin 1.8.0
git tag -d
git push origin :refs/tags/
git push --delete origin
git stash
git stash apply
git pull --rebase origin master
git rev-parse --abbrev-ref HEAD
rename = "!f() { branch_name=$(git rev-parse --abbrev-ref HEAD); git branch -m $1; git push origin $1; git push origin --delete $branch_name; }; f"