- Reference to state of the project in a specific commit
- The tags are useful as Referenced Points
- Are used to have more valuable git history
- Are commonly for the versions of a product, example : v1.0.0
-
Fastforwarding: this happend when the branch that will receive the changes DO NOT have any recently changes the merge will be a success
-
Recursive: this happend when the branch that will receive the changes HAVE recently changes but it will not a problem at the merge process
-
HEAD: Last commit(code changes point) where the current branch is.
git fetch
git push --tags
When a main (parent) branch has been updated and this changes are neccesary at all the child branches this works to pull those changes to the child branch and minimize the possible conflicts
git checkout childBranch
and then ...
git rebase mainBranch
git tag
git show nameTag
This Tag it will be referenced to the last commit
git tag nameTag
This Tag it will be referenced to a Specific commit
git tag -a nameTag shortCommitHash -m "MessageCommit"
git tag -d nameTag
and then update all local
and remote references
git remote prune origin
git branch
first step :
git fetch
second step :
git branch
git branch nameBranch
this is important to after the branch accomplish his purpose
git branch -d nameBranch
git branch -d nameBranch -f
git checkout -b nameBranch
git checkout nameBranch
Once you are at the branch that it will be renamed
git branch newBranchName
Once you are at the branch that will receive the changes(main branch)
git merge brancWithChanges
List summarized of the most important commands to use Git by @rogeralbp
git config --global -e
git init
(ready to commit and then push)
git status
git add .
this happend when a developer makes an important change that could be historic
git commit -m "AAAAAAAAAAA"
git checkout -- . | git reset --hard commitShorHash
git branch -m currentName newName
git commit -am "AAAAAAAAAAAAAA"
git log
git add *.html | *.js | *.css | etc....
this works before the files were added yo the staging area
git diff
this command is useful ti change the description of the last commit
git commit --amend -m "DescriptionUpdated"
in this command the short hash of the command is important
git reset --hard shortHast
example:
git reset --hard 85151asj
git reflog
Useful for make changes and saving in the History Git
git mv currentName.ext newName.ext
ext = .md, .js, .html, etc...
Useful for make changes and saving in the History Git
git rm file.ext
Useful for do not make the corresponding following of folders and files:
- Need to be in the home (raiz) of the project
- Inside of this file needs to be the name of those folders and files
--.gitignore
--dist/
--holamundo.html
--app.js
--profilesimgs/
--*.css
--*.log
The Aliases are useful to reduce the inverted time typing a command to execute
git config --global alias.aliasName function *flags
example:
git config --global alias.s status --short
aliasName = the symbol, letter
function = the action (commit, push , pull, status)
flags = Optional flag for the Alias
Access to global aliases
git config --global -e
- Short Description of the Status:
git config --global alias.s status --short --branch
- Short and useful metadata of the Logs:
git config --global alias.log "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"
These are possible versions to download
this is useful when a release is not completed to use already