If you know any of the Software Developer around and never heard them talking about GitHub? maybe they are having hard time managing their software versions and you could be the one telling them about the Powerful tool- "GitHub" As the picture describes it all, if you have GitHub taking your back, you turn out to be a powerful Developer taking down challenges of managing your code. This tool is used by over 40 million people to learn, share and work together to build software. Our primary discussion here would be around using git commands to manage code at different stages. So, without wasting further time, let's get started. Create a GitHub Repository Before you get going with Software Development, the first thing you need to do is setup a Git Repository. Option 1: How to create a repository on GUI? . check here Option 2: You can create local repository using command below and later push it (we will see this in some time) to your GitHub account. Command: git init Description: This will initialize a local Git repository Set up Endpoints Once you have your repository created, it's time we set up respective endpoints from where your teammates can push their versions or features of the software. How to set it up? Create a directory on the local file system. Select Clone "Clone or download" on GitHub, copy the link In Visual Studio Code, select File -> Add Folder to workspace -> Select the newly created directory Select Terminal Window In the Window, type: Command: git config --global user.name <github userID> set a name that is identifiable for credit when review version history . Description: Command: git config --global user.email <valid-email> set an email address that will be associated with each history marker . Description: Command: git config --global color.ui auto set automatic command line coloring for Git for easy reviewing. Description: Command: git clone <URL GitHub link copied earlier> from retrieve an entire repository from a hosted location via URL. Description: Git Commands If you have reached this stage, that means you have already started coding your version of the Software and ready to use other git commands to manage and share your code with others on the GitHub repository you created above. . A Stage and Snapshot: Command: git status : Description show modified files in working directory, staged for your next commit git add [file] Command: add a file as it looks now to your next commit (stage) Description: Command: git reset [file] unstage a file while retaining the changes in working directory Description: Command: git diff diff of what is changed but not staged Description: git diff --staged Command: diff of what is staged but not yet committed Description: git commit -m “[descriptive message]” Command commit your staged content as a new commit snapshot Description: B. Branch and Merge Command: git branch list your branches. a * will appear next to the currently active branch Description: Command: git branch [branch-name] create a new branch at the current commit Description: Command: git checkout switch to another branch and check it out into your working directory Description: Command: git merge [branch] merge the specified branch’s history into the current one Description: Command: git log show all commits in the current branch’s history Description: C. Inspect and Compare Command: git log show the commit history for the currently active branch Description: Command: git log branchB..branchA show the commits on branchA that are not on branchB Description: Command: git log --follow [file] show the commits that changed file, even across renames Description: Command: git diff branchB...branchA show the diff of what is in branchA that is not in branchB Description: D. Share and Update Command: git remote add [alias] [url] add a git URL as an alias Description: Command: git fetch [alias] fetch down all the branches from that Git remote Description: Command: git merge [alias]/[branch] merge a remote branch into your current branch to bring it up to date Description: Command: git push [alias] [branch] Transmit local branch commits to the remote repository branch Description: Command: git pull fetch and merge any commits from the tracking remote branch Description: E. Tracking Path Changes Command: git rm [file] delete the file from project and stage the removal for commit Description: Command: git mv [existing-path] [new-path] change an existing file path and stage the move Description: Command: git log --stat -M show all commit logs with indication of any paths that moved Description: F. Rewrite History Command: git rebase [branch] apply any commits of current branch ahead of specified one Description: Command: git reset --hard [commit] clear staging area, rewrite working tree from specified commit Description: G. Temporary Commits Command: git stash Save modified and staged changes Description: Command: git stash list list stack-order of stashed file changes Description: Command: git stash pop write working from top of stash stack Description: Command: git stash drop discard the changes from top of stash stack Description: If you want to make your life little easy after writing huge lines of code, you could manage your code using GIT's GUI version instead of commands we saw above. Installations available for different versions as below, | GitHub for Windows GitHub for Mac For Linux and Solaris platforms, the latest release is available on the official Git web site I hope this content has been informative for you and would like to thank you for investing 7 mins of your valuable time reading this article.