Terminal: the command I always use during development

Create a project app you need to know about terminal command

Jerry PM
3 min readSep 21, 2021
Photo by Goran Ivos on Unsplash

This command on terminal mostly I was use when build iOS app. although there are many tools that can be used but I still often use the command in the terminal. Because it feels more comfortable when I use that, and also another advantage is that it is fast than opening other applications for the process.

For make terminal easy to use, I’ve install “oh-my-zsh” theme just running this command into your terminal.

$sh -c “$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
source: Author

Git

When developing applications for Git I use two tools, I use both tools like sourcetree and terminal. I use this command often

$git pull origin master 
// update branch
$git checkout -f branch/name
// change force checkout branch, for clean branch will change
$git checkout -b branch/name
// create new branch from parent like master or parent branch
$git add .
// add data to commit
$git rebase --continue
// if condition conflict after rebase from parent/master
$git push -f origin branch/name
// push git after rebase if not conflict
$git status
// To see what project on progress
$git reset --hard
// Reset last commit
$git cherry-pick <commit-hash>
//ex: $git cherry-pick dg1234a7
// I use this for pick one commit from other branch
// and add to my branch
//after cherry-pick force push to your branch
$git push -f origin <branch
// ex: git push -f origin feature/nameBrach
$ git reset --soft HEAD~1
// undo last commit
$git rebase --quit
// when I quit branch and get back still have rebase
*******
Last commands done (2 commands done):
pick 4214e07f onboard page
pick e31v01c brokerage firm
Next commands to do (141 remaining commands):
pick 607131636 add ?? entry point
pick z61fdc3s7 update UI brokerage firm
(use "git rebase --edit-todo" to view and edit)
You are currently editing a commit while rebasing branch 'branch/feature/ME-??' on 'r3e173ad'.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
*******
// so I use this command$ git stash
//Stash the changes in a dirty working directory away
$ git stash apply
// calling git stash, you can check stash list in sourcetree or use // this git below
$ git stash list
// check all stash on the list
$ git config --list
// For check config (you can check what user you use)
//New You can just delete .git. Typically://For cancel git init
$rm -rf .gitPod

when running command pod in terminal this, These are some of what I often do when making applications.

$open init
// Init pod into project
$open podfile
// open file pod in project
$pod install
// Install pod after set some pod in podfile
$arch -x86_64 pod install
// this for M1 condition
$arch -x86_64 pod install --repo-update
// -
$pod --version
// Check pod version

Basic CLI commands

For a basic command line interface on modern Macs, it’s sometimes fun, so it makes me feel more professional :)

$xed .
// open xcode project file format (.xcworkspace)
// this better than use "open file/file"
$cd
//Change directory (cd) go to main directory
$cd ../
// The command "cd ../" in the terminal is used to navigate to the // parent directory of the current directory.
// ex:
// ➜ cashier_mate_playstore git:(new/playstore) ✗ cd android
// ➜ android git:(new/playstore) ✗ cd ../
// ➜ cashier_mate_playstore git:(new/playstore) ✗
$open file/subfile
// for this command for basic open file

--

--