Christoffer Hammarström

less info
454 reputation
46
bio website
location Sweden
age
visits member for 3 years, 11 months
seen Apr 7 at 20:05

Oct
8
comment Why does checking whether a folder exists using -d on an empty string return true?
I would just write that as rm -rf $ARTIFACTS without the /*. This would also delete the $ARTIFACTS directory, which is fine, because if i want to be sure that it exists before putting something in it, i will execute mkdir -p $ARTIFACTS anyway. It will also delete hidden files inside $ARTIFACTS, which is also fine, because i wouldn't write rm -rf $ARTIFACTS/* if $ARTIFACTS contained anything i wanted to save.
Aug
24
awarded  Enlightened
Jul
1
comment How to rename multiple files in a directory in some pattern in Linux?
Two things: Use * instead of `ls`, and quote ${i}: "${i}".
Jun
5
awarded  Yearling
May
2
awarded  Good Answer
Mar
7
suggested suggested edit on git out of memory
Apr
19
awarded  Nice Answer
Feb
16
comment How to make “rm” require root privilege?
I agree with @CJBrew. And i think if you keep typing rm when you mean mv, and don't have backups or a versioning system (git-scm.com) or at least a recycle bin or something (pages.stern.nyu.edu/~marriaga/software/libtrash), you kind of deserve to lose files.
Feb
16
awarded  Critic
Feb
16
comment How to make “rm” require root privilege?
Yes, doing this will break the system. Someone should unaccept this answer.
Jan
10
comment I am running Windows 7 and want to remove “Games Explorer”
So, why do you want to do this?
Dec
15
awarded  Yearling
May
11
awarded  Tumbleweed
Dec
21
revised GIT merge master into a branch
added 140 characters in body
Dec
21
comment GIT merge master into a branch
What do you mean "can't see my branch anymore"? Anyway, git rebase should only be used if the branch hasn't been distributed, which i assumed was the case since you said it was a new branch, sorry about that. See Recovering from upstream rebase in the docs i linked to. You'll have to use git merge instead. And you can use git reflog to find your previous feature branch head if you want to get it back.
Dec
21
comment GIT merge master into a branch
No, with the feature branch checked out, do git rebase master, and it will "rebase" the changes in the feature branch so that they are "based" on the changes in the master branch. If the changes in the master branch conflict with the changes in the feature branch, git will ask you to resolve them and continue, skip them, or abort. If you feel unsure you can checkout a test branch to try it on with git checkout -b test-feature feature (assuming your feature branch is named "feature").
Dec
20
awarded  Editor
Dec
20
revised GIT merge master into a branch
added 161 characters in body; added 10 characters in body
Dec
20
answered GIT merge master into a branch
Dec
13
awarded  Supporter