These are basic git commands which is required in daily code managing.
-To start project
– To get latest code from remote
– To set your local code in remote
– Deleting branch
– Deleting file
– Revert to previous commit
Basic Git Commands:-
git clone git-path
git branch (to list branch default will be master)
git checkout -b develop (create and redirect to develop branch)
git push origin develop(setting develop to git remote server)
git checkout -b feature-branch(your local development branch)
git status (check status of your worked files)
git add .
git commit – m “worked on this feature”
git checkout develop (redirect to develop branch)
git pull origin develop(taking latest code from develop)
git merge –no-ff feature-branch(merging your local feature branch)
git push origin develop
git branch -d feature-branch (deleting local branch)
git branch -D feature-branch (hard deleting local branch)
git rm -rf file-name (deleting file from git)
git reset –hard HEAD (step back to last commit)