GeekCoding101

  • Home
  • GenAI
    • Daily AI Insights
    • Machine Learning
    • Transformer
    • Azure AI
  • DevOps
    • Kubernetes
    • Terraform
  • Tech
    • CyberSec
    • System Design
    • Coding Notes
  • About
  • Contact
git
Coding Notes

Git Notes

Hi there! Recently, I've spent some time to organize my git commands notes. I know you can find those commands online easily, but I would like to share these what I think useful and put them together here for my own references. Let's take a look! General Settings You will notice that, for each commit, it has both author name and committer name. Branches Operations Command Get current working branch git branch Checkout specific branch git clone -b specific_branch --single-branch http://username@192.168.99.100:8080/scm/your-repo.git Create a branch git checkout -b new_branch Push to remote branch git push origin remote_branch Delete local branch git branch -d <branch> Delete remote branch git push origin :[name_of_your_new_branch] Fast-forward merge Git Clone Clone into current directory Git Checkout Check out files deleted locally Sometimes, you might accidently delete some files in your local repos. Then you can use below command to pull them back from remote: Clone a subdirectory only of a Git repository What you are trying to do is called a sparse checkout. This creates an empty repository with your remote, and fetches all objects but doesn't check them out. Then do: Now you need to define which files/folders you want to actually check out. This is done by listing them in .git/info/sparse-checkout, eg: Last but not least, update your empty repo with the state from the remote: You will now have files "checked out" for "temp" folder on your file system, and no other paths present. Clone specific branch of a Git repository Just use singel-branch option: Git Remote I was wondering what is a git remote, here is:…

January 6, 2018 0comments 505hotness 0likes Geekcoding101 Read all
Newest Hotest Random
Newest Hotest Random
Kubernetes Control Plane Components Explained A 12 Factor Crash Course in Python: Build Clean, Scalable FastAPI Apps the Right Way Golang Range Loop Reference - Why Your Loop Keeps Giving You the Same Pointer (and How to Fix It) Terraform Associate Exam: A Powerful Guide about How to Prepare It Terraform Meta Arguments Unlocked: Practical Patterns for Clean Infrastructure Code Mastering Terraform with AWS Guide Part 1: Launch Real AWS Infrastructure with VPC, IAM and EC2
Terraform Associate Exam: A Powerful Guide about How to Prepare ItGolang Range Loop Reference - Why Your Loop Keeps Giving You the Same Pointer (and How to Fix It)A 12 Factor Crash Course in Python: Build Clean, Scalable FastAPI Apps the Right WayKubernetes Control Plane Components Explained
The Hallucination Problem in Generative AI: Why Do Models “Make Things Up”? Install Azure-Cli on Mac Why is the Transformer Model Called an "AI Revolution"? Docker Notes Password Authentication in Node.js: A Step-by-Step Guide Unlocking Web Security: Master JWT Authentication
Newest comment
Tag aggregation
AI Daily.AI.Insight cybersecurity notes security Supervised Machine Learning Transformer Machine Learning

COPYRIGHT © 2024 GeekCoding101. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang