3 added 93 characters in body
source | link

You're archiving paths of the form top-tree/stuff and excluding paths of the form /home/skrowten/top-tree/stuff. Your exclusion patterns never match anything.

The simple solution is

tar -czvf archive.tar.gz --exclude=top-tree/branch1/branch11/branch114 --exclude=top-tree/.git --exclude=top-tree/branch1/branch11/.idea top-tree

Note that if there is e.g. a top-tree/subdir/top-tree/.git then this will be excluded as well. A trick to avoid this is to start the command line path with ./, and rely on the fact that . will only ever appear at the root.

tar -czvf archive.tar.gz --exclude=./top-tree/branch1/branch11/branch114 --exclude=./top-tree/.git --exclude=./top-tree/branch1/branch11/.idea ./top-tree

If the leading ./ bothers you, add the option --transform='s!^\./!!' to the tar call.

You're archiving paths of the form top-tree/stuff and excluding paths of the form /home/skrowten/top-tree/stuff. Your exclusion patterns never match anything.

The simple solution is

tar -czvf archive.tar.gz --exclude=top-tree/branch1/branch11/branch114 --exclude=top-tree/.git --exclude=top-tree/branch1/branch11/.idea top-tree

Note that if there is e.g. a top-tree/subdir/top-tree/.git then this will be excluded as well. A trick to avoid this is to start the command line path with ./, and rely on the fact that . will only ever appear at the root.

tar -czvf archive.tar.gz --exclude=./top-tree/branch1/branch11/branch114 --exclude=./top-tree/.git --exclude=./top-tree/branch1/branch11/.idea ./top-tree

You're archiving paths of the form top-tree/stuff and excluding paths of the form /home/skrowten/top-tree/stuff. Your exclusion patterns never match anything.

The simple solution is

tar -czvf archive.tar.gz --exclude=top-tree/branch1/branch11/branch114 --exclude=top-tree/.git --exclude=top-tree/branch1/branch11/.idea top-tree

Note that if there is e.g. a top-tree/subdir/top-tree/.git then this will be excluded as well. A trick to avoid this is to start the command line path with ./, and rely on the fact that . will only ever appear at the root.

tar -czvf archive.tar.gz --exclude=./top-tree/branch1/branch11/branch114 --exclude=./top-tree/.git --exclude=./top-tree/branch1/branch11/.idea ./top-tree

If the leading ./ bothers you, add the option --transform='s!^\./!!' to the tar call.

2 deleted 15 characters in body
source | link

You're archiving paths of the form top-tree/stuff and excluding paths of the form /home/skrowten/top-tree/stuff. Your exclusion patterns never match anything.

To exclude specific paths, start the exclude pattern with a slash followed by a path starting from the top of what you're putting into the archive (the member names)The simple solution is

tar -czvf archive.tar.gz --exclude=top-tree/branch1/branch11/branch114 --exclude=top-tree/.git --exclude=top-tree/branch1/branch11/.idea top-tree

Note that if there is e. For example,g. a --exclude=/top-tree/.git excludes top-treesubdir/.git (and everything underneath it, since the exclusion prevents tar from traversing the directory) but not top-tree/subdir/.git then this will be excluded as well. OnA trick to avoid this is to start the other hand,command line path with --exclude=.git/ excludes, and rely on the fact that .git will only ever appear at any depththe root.

tar -czvf archive.tar.gz --exclude=./top-tree/branch1/branch11/branch114 --exclude=./top-tree/.git --exclude=./top-tree/branch1/branch11/.idea ./top-tree/

You're archiving paths of the form top-tree/stuff and excluding paths of the form /home/skrowten/top-tree/stuff. Your exclusion patterns never match anything.

To exclude specific paths, start the exclude pattern with a slash followed by a path starting from the top of what you're putting into the archive (the member names). For example, --exclude=/top-tree/.git excludes top-tree/.git (and everything underneath it, since the exclusion prevents tar from traversing the directory) but not top-tree/subdir/.git. On the other hand, --exclude=.git excludes .git at any depth.

tar -czvf archive.tar.gz --exclude=/top-tree/branch1/branch11/branch114 --exclude=/top-tree/.git --exclude=/top-tree/branch1/branch11/.idea top-tree/

You're archiving paths of the form top-tree/stuff and excluding paths of the form /home/skrowten/top-tree/stuff. Your exclusion patterns never match anything.

The simple solution is

tar -czvf archive.tar.gz --exclude=top-tree/branch1/branch11/branch114 --exclude=top-tree/.git --exclude=top-tree/branch1/branch11/.idea top-tree

Note that if there is e.g. a top-tree/subdir/top-tree/.git then this will be excluded as well. A trick to avoid this is to start the command line path with ./, and rely on the fact that . will only ever appear at the root.

tar -czvf archive.tar.gz --exclude=./top-tree/branch1/branch11/branch114 --exclude=./top-tree/.git --exclude=./top-tree/branch1/branch11/.idea ./top-tree
1
source | link

You're archiving paths of the form top-tree/stuff and excluding paths of the form /home/skrowten/top-tree/stuff. Your exclusion patterns never match anything.

To exclude specific paths, start the exclude pattern with a slash followed by a path starting from the top of what you're putting into the archive (the member names). For example, --exclude=/top-tree/.git excludes top-tree/.git (and everything underneath it, since the exclusion prevents tar from traversing the directory) but not top-tree/subdir/.git. On the other hand, --exclude=.git excludes .git at any depth.

tar -czvf archive.tar.gz --exclude=/top-tree/branch1/branch11/branch114 --exclude=/top-tree/.git --exclude=/top-tree/branch1/branch11/.idea top-tree/