Notice
Recent Posts
Recent Comments
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
Archives
Today
In Total
관리 메뉴

A Joyful AI Research Journey🌳😊

Git: Using terminal 본문

🌳List of Materials✨/Git

Git: Using terminal

yjyuwisely 2023. 7. 24. 18:13
Create a Branch
  • Create branch when master branch is checked out. Here commits in master will be synced to the branch you created.
  • git branch branch1
  • Create branch when branch1 is checked out . Here commits in branch1 will be synced to branch2 git branch branch2

Checkout a Branch

git checkout command switch branches or restore working tree files

  • git checkout branchname

Renaming a Branch

  • git branch -m branch1 newbranchname

Delete a Branch

  • git branch -d branch-to-delete
  • git branch -D branch-to-delete ( force deletion without checking the merged status )

Create and Switch Branch

  • git checkout -b branchname

Branches that are completely included

  • git branch --merged

Branch Differences [ git diff branch1..branch2 ]

Multiline difference

  • git diff master..branch1

Singleline difference

  • git diff --color-words branch1..branch2

https://stackoverflow.com/questions/4470523/create-a-branch-in-git-from-another-branch

 

Create a branch in Git from another branch

I have two branches: master and dev I want to create a "feature branch" from the dev branch. Currently on the branch dev, I do: git checkout -b myfeature dev ... (some work) git commit -...

stackoverflow.com


728x90
반응형
Comments