https://dzone.com/articles/top-20-git-commands-with-examples
https://about.gitlab.com/blog/2016/12/08/git-tips-and-tricks/#the-most-common-commands
Command | Effect |
---|---|
git status | Lists all the files that have to be committed. |
git add [File name] | This command adds a file to the staging area. |
git commit . -m [Type in the commit message]' | This command records or snapshots the file permanently in the version history. |
git branch | This command lists all the local branches in the current repository. |
git branch [branch name] | This command creates a new branch. |
git branch -D [branch name] | This command deletes the feature branch locally. |
git push origin --delete [branch name] | This command deletes the feature branch in the remote repository. |
git checkout [branch name] | This command is used to switch from one branch to another. |
git checkout [branch copying from] [file name] | Merging single file from other branch to current branch. |
git merge [branch name] | This command merges the specified branch’s history into the current branch. |
git push origin master | This command sends the committed changes of master branch to your remote repository. |
git push origin [branch] | This command sends the branch commits to your remote repository. |
git pull origin load_balancer | This command pulls the branch commits to your local branch. |
git push –all origin | This command pushes all branches to your remote repository. |
git pull | This command fetches and merges changes on the remote server to your working directory. |
git checkout --track origin/branch_name | Adds a tracking for a repository |