Home
About
DEVELOPMENT SERVICES
Web Applications
Mobile App
Golang Web
WordPress
Shopify Web
iOS App
Hire Categories
Hire NodeJS Developer
Hire React JS Developer
Hire WordPress Developer
Hire Laravel Developer
Hire Flutter App Developer
Hire Shopify Developer
Hire Golang Developer
Case Studies
Case Study : Fino let App
Case Study : Athlete Talk App
Case Study : Live Life App
ALL CASE STUDY
careers
Talent Acquisition Specialist in pilani
read more
Manual + Automation Tester in pilani
read more
Frontend Software Developer in pilani
read more
Senior PHP/JS Developer – Website Platform in pilani
read more
VIEW ALL jobs
SERVICES AREAS
Web Applications Development services
Analytics and Reporting Tools Integration service
Mobile App Development Services
Enterprise IT Solutions
Machine Learning Model Implementation
Cloud Applications & Integrations
DevOps Consulting Services
IT Staffing
TEAM
Contact Us
Blogs
10 Useful git commands for beginner developers
Rahul Mishra
-
June 23, 2022
Create a git branch
git checkout -b branch-name
Pull from remote overwriting local changes
git stash (revert and stash changes locally)
git pull (pull from remote normally)
tip
: to retrieve changes, do ‘git stash apply
Delete untracked files from the working tree
git clean -f -d
Unstaged files from the index (but keep the files locally)
git rm –cached
Undo a merge
git checkout branch-name
git log –oneline
git revert -m commit-id
Remove a file from remote
git rm filename (remove the file from git)
git commit -m “commit message”
git push
Undo last n commits
git reset –soft HEAD^n (where n is the number of last commits you want to undo)
See diff between branches
git diff branch_1..branch_2
Remove a tag from the branch
git push origin :refs/tags/tagname
git tag -d
Rename a branch locally & remote
git checkout old-branch
git branch -m new-name
git push origin :old-name new-name
I have taken a reference from this
Tweet.
Back to Listing
Similar Artcles
10 Useful git commands for beginner developers
read more
Top 10 Reasons – Flutter Is Better For Your App Development
read more
Why is Shopify the best fit for your E-Commerce business?
read more