Categories
git Linux MAC OS X

#git switch to branch without merge on local repo

To switch from master to a branch or branch to another without merge.

git branch
*ma
ster

$ git fetch origin <new_branch>

$ git checkout
Branch legacy set up to track remote branch legacy from origin.
Switched to a new branch ‘new_branch'

$ git pull

$ git branch
* new_branch
master

Categories
git Linux MAC OS X

git # move directory or file

Move or rename a file, a directory, or a symlink

# clone the repo
git clone <repo-url>
git mv <source_file_or_directory> <destination>
git status # will show the change details
git commit -am "comment_for_the_change"
git push # push changes to repo