LoginSignup
0
0

More than 1 year has passed since last update.

Git cmd (Note)

Last updated at Posted at 2021-06-11

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

  1. Go to source folder.
  2. Add source to Git.
    1. git init For first time using git
    2. git remote add origin [GIT_LINK : Will get after created repository] Set a new remote
    3. git remote -v Verify new remote : Will show detail of process

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

  1. Clone the original project for create branch.
  2. Go to No.1's project folder.
  3. Switch to new b
    1. git checkout -b [NEW_BRANCH_NAME] [No.1's BRANCH_NAME or MASTER]
  4. Push created branch to remote.
    1. 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
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0