Top Git commands for SDETs | Easy breakdown
I have listed important commands which are used day to day for managing code on remote repositories. Use these as a basis and master it for your further experience.
To initialise a repository or create new git repository in your local system —
Command: git init
What are the new changes and files updated in your code?
Command: git status
How to add files to the staging area?
Command: git add * / git add <filename>
How to commit code to local git repo? (local repository not yet pushed to remote)
Command: git commit -m “<message>”
How to push code to a remote repository?
Ans: i. First you need to authenticate yourself by using token or basic authentication
iii. After this you can create a repository on your github account
iii. Copy the http url, then use following
Command: git remote add origin <remote_url>
Now finally pushing the code to remote repository
Command: git push origin <branch_name>
How to review the current branch?
Command: git branch (it reflects all existing branches and…