Git Basic Syntax Notes

Basic Git workflow for beginners.

1. Install Git

Download from https://git-scm.com/. Verify: git --version

2. Configure Git

git config --global user.name 'Your Name'
git config --global user.email 'your_email@example.com'

3. Create Repository

mkdir my_project
cd my_project
git init

4. Stage Files

git add README.md    # Add specific file
git add .            # Add all files

5. Commit Changes

git commit -m 'Initial commit'

6. Check Status & History

git status    # Working tree status
git log       # Commit history

7. Branch Operations

git branch feature-branch       # Create branch
git checkout feature-branch     # Switch branch
git checkout -b feature-branch  # Create and switch

8. Merge Branches

git checkout main
git merge feature-branch

9. Remote Repository

git remote add origin <repository-url>
git push -u origin main
git pull origin main

10. Clone Repository

git clone <repository-url>

References

Practice Exercises

  1. Create a new branch, make three commits on different files, then use git rebase -i to squash them into a single commit. What happens to the commit history, and why might you want to use rebase vs. merge?
  2. Simulate a merge conflict: have two branches modify the same line of the same file, then practice resolving the conflict manually. What strategies does Git provide to help with conflict resolution?
comments powered by Disqus

Related Posts

AGORA2: Genome-scale metabolic reconstruction of 7,302 human microorganisms for personalized medicine

Literature Title: Genome-scale metabolic reconstruction of 7,302 human microorganisms for personalized medicine.

Read More

HMOs Cell Factory — Conference Notes

Human milk oligosaccharides (HMOs) are a class of structurally diverse complex carbohydrates that serve as prebiotics, anti-adhesive antimicrobials, and immunomodulators in infant nutrition. Industrial production of HMOs via microbial fermentation has attracted significant interest, yet several bottlenecks remain: low substrate specificity of glycosyltransferases, difficult co-regulation of precursor synthesis pathways, and unclear key regulatory targets. This post summarizes conference notes from LiuLong (JiangNan University) on a series of strategies addressing these challenges through an integrated synthetic biology workflow.

Read More

Adding Disqus Comments to Hugo

Hugo supports two popular comment systems:

  1. Disqus — a third-party social comment platform.
  2. Giscus — a comment system based on GitHub Issues/Discussions.

This post covers Disqus setup.

Read More
/js/script.js