git diff --name-only tag..masterThis command is useful if you want to cancel your last n commits and conserve all the modifications.
git reset --soft HEAD~nn is the number of commit to reset.
git reset --merge ORIG_HEADUseful commands you use for creating a patch for clients.
git diff --name-only tag..master | xargs zip name.zipThis command will make a zip file from the diff.
If you want to delete a part of the path you have to do this:
git diff --name-only tag..master | sed "s/project\///" | xargs zip name.zipproject is the part of the path you want to delete.
git checkout -b branch_namegit checkout branch_namegit merge branch_nameThis command will merge branch_name into your current branch. For exemple, if you are on the master, this will merge the selected branch into master.
git branch -d branch_namegit branch -D branch_namegit push origin :branch_namegit fetch origin
git reset --hard origin/branch_namegit branch --mergedShow merged branches in the current branch.
git branch --no-mergedShow unmerged branches in the current branch.
git tag tag_namegit push origin tag_namegit tag -d tag_namegit push origin :tag_namegit config --global tag.sort version:refnameTo add an empty directory, you have to create an empty file named .gitkeep and then commit this file.
git log --diff-filter=A -- filepathfind . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch