How to create a symbolic or soft link? syntax: ln [-s] source symbolic link e.g: ln -s src/build/llvm/install/bin ./my_bin How to grep all file exclude a ctag file : tags? alias gnt='grep -rn --exclude="tags"' How to get the current directory of the running script? DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" Bash maintains a number of variables including BASH_SOURCE which is an array of source file pathnames. ${} acts as a kind of quoting for variables. $() acts as a kind of quoting for commands but they're run in their own context. dirname gives you the path portion of the provided argument. cd changes the current directory. pwd gives the current path. && is a logical and but is used in this instanc...
Convention: %H : commit hash %h : abbreviated commit hash How to how logs of one given file git log --pretty=oneline file name How to show just the file names changed in a patch? git show %H --name-only How to do a git squash? e.g. If I want to squash the two commits on HEAD. (a) git rebase -i HEAD~2 git will bring all a editor with the following message: pick 8157e2b Test 1. pick 05532ed Test 2. (b) change the second 'pick' to 'squash', which means squash commit 2 (Test2) into commit 1 (Test1) (c) Save and quite. git will combine the two commits together and bring up a new editor. Like: # This is a combination of 2 commits. # The first commit's message is: Test 1. # This is the 2nd commit message: Test 2. Edit the message again and save and quite. Like Test1 && Test2 Successfully rebased and updated refs/heads/master. If you do a 'git log' after the combination, you will find the new combin...
Comments
Post a Comment