Basic of git

Git is software for tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data integrity, and support for distributed, non-linear workflows.

20 Git commands Every Developer should know-

🔸git init - Initialize or reinitialize a repository.

🔸git clone clone a repository.

🔸git add - add to staging area.

🔸git add -A - add new files, update, modified files and remove deleted files from staging area.

🔸git status-current status of working tree.

🔸git diff - show all unstaged changes.

🔸git commit -m “commit message here”- commit staged changes.

🔸git merge<branch-name> -merge a branch with current directory.

🔸git branch -d<branch-name> - delete a branch

🔸git checkout<tag> — checkout a specific tag

🔸git mv index.html file.html - move index.html to file.html

🔸git log - shows all the commits, author name, time

🔸git push origin master - pushes to remote master branch.

🔸git stash - save all local changes.

🔸git stash pop - apply and drop all the saved changes.

🔸git stash apply- only apply all the previously saved changes

🔸git tag - display all the tags.

🔸git fetch origin master - fetch from a remote repository

🔸git pull origin master - fetch and merge from remote repository.

🔸git remote -v - verify the remote.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store