Discuss your project

Topic

git

3 articles

Git: export revisions with file structure

To perform an export, similar to how tortoiseSVN does which allows exporting files from one or several revisions, along with their directory structure (which is convenient for a production deployment), simply execute the following command, specifying the previous revision and the latest revision: git diff-tree -r --no-commit-id --name-only 6c16aaab 35168851| xargs tar -rf /var/www/delivery.tar Precautions before executing the order This tutorial retains the command and the context of its...

Delete a branch in git

To completely remove a branch from your git server (including history), simply use the following command:git push origin --delete [branch name]Then you need to run the following command on the instances to remove the information of the deleted branch: git fetch --all --pruneIf for one reason or another, you need to delete one or more files from previous commits, here is an interesting article on the subject:https://help.github.com/articles/remove-sensitive-data/ Precautions before executi...

do a hard reset of a working copy in git

To revert to a clean working copy, you can delete all the files in your directory, leaving the hidden git files, and run the following command:git reset --hard origin/dev Precautions before executing the order This tutorial retains the command and the context of its publication. Before using it on a current repository, inspect the branch, the modified files, and the exact target: git status --short git log --oneline --decorate -5 Create a backup branch or tag when the operation rewrites hi...