Compare commits

..

2 Commits

Author SHA1 Message Date
Fernando Miguel
8772dd6e7d Merge cf584f84f7 into 88e5be6e4b 2025-02-06 17:56:03 +08:00
Fernando Miguel
cf584f84f7 Adding git switch and git restore commands
Git has introduced git switch and git restore in order to keep more purposeful scope for the git checkout command which holds more responsibility than simply switch branches.
2022-05-28 07:01:14 +02:00
3 changed files with 4 additions and 7 deletions

View File

@@ -95,9 +95,3 @@ arr.reduce(callback[, initialValue]) // Apply a function against
arr.reduceRight(callback[, initialValue]) // Apply a function against an accumulator and each value of the array (from right-to-left) as to reduce it to a single value.
arr.some(callback[, initialValue]) // Returns true if at least one element in this array satisfies the provided testing function.
arr.values() // Returns a new Array Iterator object that contains the values for each index in the array.
// String methods
String.charAt(index) // Returns the character at the specified index in a string.
String.indexOf(character) // Returns the index of the first occurrence of a specified value in a string.
String.substring(starting_index, ending_index) // Returns a new string that is a subset of the original string.
String.substring(starting_index) // Returns a substring from starting index to last index of string.

View File

@@ -31,14 +31,18 @@ git branch # shows all the branches (current branch is s
git branch -a # shows all the branches local and remote
git branch my-branch # creates my-branch
git checkout -b my-branch # create and switches to my-branch
git switch -c my-branch # create and switches to my-branch
git branch -d my-branch # deletes my-branch
git checkout my-branch # switches to my-branch
git switch my-branch # switches to my-branch
git merge my-branch # merges my-branch to current branch
git push origin --delete my-branch # delete remote branch
git branch -m <new-branch-name> # rename the branch
git checkout --orphan <branch_name> # checkout a branch with no commit history
git branch -vv # list all branches and their upstreams, as well as last commit on branch
git branch -a # List all local and remote branches
git restore # Restore specified paths in the working tree
git cherry-pick <commit_id> # merge the specified commit
git cherry-pick <commit_id_A>^..<commit_id_B> # pick the entire range of commits where A is older than B ( the ^ is for including A as well )

View File

@@ -21,7 +21,6 @@ cat /proc/<process_id>/maps # Show the current virtual memory usage of a Linux
ip r # Display ip of the server
lsof -i :9000 # List process running on port 9000
kill -9 $(lsof -t -i:PORT) # Kill the process running on whichever port specified
journalctl -u minio.service -n 100 --no-pager # List last 100 logs for specific service