Content
- Check Git version
- Add source to Git
- Clone
- Create new branch
- Delete branch
- Pull
- Push
- Merge
Check Git version
- git version
Add source to remote
- Go to source folder.
- Add source to Git.
- git init
For first time using git
- git remote add origin [GIT_LINK : Will get after created repository]
Set a new remote
- git remote -v
Verify new remote : Will show detail of process
- git init
Clone
Clone master of Git repository
- git clone [GIT_LINK]
Clone branch of Git repository
- git clone -b [BRANCH_NAME] [GIT_LINK]
Create new branch
- Clone the original project for create branch.
- Go to No.1's project folder.
- Switch to new b
- git checkout -b [NEW_BRANCH_NAME] [No.1's BRANCH_NAME or MASTER]
- Push created branch to remote.
- git push --set-upstream origin [NEW_BRANCH_NAME]
Delete branch
- git push --delete origin [BRANCH_NAME]
Pull
Firstly, go to project folder and run following command.
pull lastest source from master
- git pull origin master
pull lastest source from branch
- git pull origin [BRANCH_NAME]
Push
- git push
Merge
Merge
- git merge [BRANCH_NAME]
Cancel merge
- git merge --abort