You are on page 1of 2

The origin Remote

When you clone a repository with git clone, it automatically creates a remote
connection called origin pointing back to the cloned repository. This is useful for
developers creating a local copy of a central repository, since it provides an easy
way to pull upstream changes or publish local commits. This behavior is also why
most Git-based projects call their central repository origin.

https://www.atlassian.com/git/tutorials/syncing/git-pull

================Basic GIT Commands=====================================


git config --global user.email "emailid"
git config --global user.name "yourGITHubUsername"

git init
git status --status of GIT
git add
git commit -m "...."
git remote add origin URL
git push -u origin master/Mybranch
git log
git --help

git checkout -- TestCreateEnrollment.java

==============Branching and Merging=====================================

Create branch
git branch "branch name"

Checkout branch
git checkout "branch name"

Merge new Branch in master branch


first checkout master then merge
git merge "branch name"

then push

Delete branch
git branch -d "branch name" --delete from local
git push origin --delete "branch name" --delete from remote

===================GIT Tagging============================

Checkout GIT
git checkout master

Create a tag with some name


git tag <tag name>
git tag v1.0
git tag -a v1.1 -m "tag for release ver 1.1" (to create annotated tags)

Display or show tags


git tag
git show v1.0
git tag -l "v1.*"

Pushing tag to remote


git push origin v1.0
git push origin --tags
git push --tags to push all my tags to repository

Delete tags(if required only)

to delete tags from local


git tag -d v1.0
git tag --delete v1.0

to delete tags from remote


git push origin -d v1.0
git push origin --delete v1.0
git push origin :v1.0

You might also like