Giter Club home page Giter Club logo

fastcampus's Introduction

패스트캠퍼스

메가바이트스쿨 BE 4기

📅 Period

2022.12 12 ~

📚 Stacks

badge
emoji

💻 Study

:octocat: Git

📁 Git, Github (1)

mkdir [new folderName]
rm -rf [delete folderName]
git init
git remote add origin [repo addr]
git add .
git commit -m"[commit comment]"
git log --oneline
git revert [revert version]
git reset --soft/hard/mixed [reset version]
git push/pull origin [branch]
git branch -m [branch]
git clone [repo addr]

VsCode 단축키
ctrl + shift + ~ : TERMINAL ON


📁 Git, Github (2)

git config --global init.defaultBranch main
//git init하면 default branch main으로
git branch -m main
//branch를 main으로
git switch -c [new branchName]
git switch [branchName]
//checkout보다 switch
git branch --list
git branch -d [delete branchName]
rm -rf .git
git merge [merge할 branchName]
//실무에선 command로 merge할 일은 없음
git log --oneline --graph --decorate
git merge [merge할 branchName] --no-ff
//fast-forward로 merge 안 하게
git rebase [rebase할 branchName]
git fetch --prune
//pr하고 삭제된 branch 정리
//로컬 브랜치도 -d로 삭제(띄어쓰기로 구분)

📑 Github default branch 변경하기 (master to main)

git branch -m master main
git push -u origin main

clone의 경우

git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a

📑 How do I delete a Git branch locally and remotely?

git push -d [remoteName] [branchName]
git branch -d [branchName]

Note: In most cases, [remoteName] will be origin.


📁 Git, Github (3)

git pull [remoteName] [branchName] --no-ff
//git pull error시

commit 본문을 쓰기보단 PR 본문을 쓰는 게 효율적

📑 How do I undo 'git add' before commit?

git reset [file]

if this tried then

fatal: Failed to resolve 'HEAD' as a valid ref.

solution

git rm -r --cached [file]

fastcampus's People

Contributors

ju-ei8ht avatar

Stargazers

gimseonjin616 avatar

Watchers

 avatar

fastcampus's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.