1- git checkout develop
2- git pull origin develop
3- git checkout -b 'newBranchName'
4- git add .
5- git commit -m 'a meaningful commit message.'
6- git push
1- git pull origin develop
2- git checkout [TheMergingBranchName]
3- git pull origin [TheMergingBranchName]
4- Inspect the code and project to make sure everything is running smoothly
5- git checkout develop
6- If the branch is in your local branches:
git merge [TheMergingBranchName]
If it isn't:
git merge origin/[TheMergingBranchName]
7- git push origin develop / git push
Usage: git add [file]
This command adds a file to the staging area.
Usage: git commit -m “[ Type in the commit message]”
This command records or snapshots the file perman
Usage: git commit -am 'Type in the commit message'
git add & git commit combined.
Usage: git diff
This command shows the file differences which are not yet staged.
Usage: git reset [file]
This command unstages the file, but it preserves the file contents.
Usage: git status
This command lists all the files that have to be committed.
Usage: git log
This command is used to list the version history for the current branch.
Usage: git show [commit]
This command shows the metadata and content changes of the specified commit.
Usage: git branch -b [branch name]
This command creates a new branch and checks out to it.
Usage: git checkout [branch name]
This command is used to switch from one branch to another.
if you want to checkout into branch, write branch name:
git checkout
Usage: git merge [branch name]
This command merges the specified branch’s history into the current branch.
Usage: git push [variable name] [branch name]
This command sends the committed changes of master branch to your remote repository.
Git Push Command - Git Commands - Edureka
Usage: git pull [Repository Link]
This command fetches and merges changes on the remote server to your working directory.
Usage: git log --oneline
Summarize the log in one line expressions
Usage: git tag [commitID]
This command is used to give tags to the specified commit. First, local commits should be Tagged. Tag the commit where the commit head is by default.
Tag the specific commit git tag 'version 1.0.0' [commitID]
Lastly, local tags should be pushed. git push origin [TagName]
Usage: git remote -v
See fetch and push origins for the current repository.
Usage: git remote remove origin
See fetch and push origins for the current repository.
Usage: git remote add origin [OriginLink]
Origin: Short name of GitHub links (Example: git push https://github.com/erfanakhavanrad/gitdemo.git equivalents to git push origin)
Develop: Tested and ready branch to use version for testers. Contains the latest features, Therefore ahead of all branches.
©Erfan Akhavan Rad