For instance in this part of a code I need to ignore the line contain 'console.log' by git. Is it possible to define a tag or something like this to inform git to ignore that?
this.service.doRequest(req).subscribe(
onComplete => {
this.subActions = onComplete;
console.log('Container(actions) result:',this.subActions); //need to ignore this line by git
}, onError => {}
);
You cannot directly exclude a line on commit itself.
You can use git add -p to add specific parts of your file (except the one you do not want), and then commit.