EADST

Git Branch Setup, Upload, and Tag Management

A quick guide to managing Git branches and tags for project releases.

Branch Setup and Upload

Creating a New Branch

git checkout -b feature-branch

Uploading Local Project to Remote Repository

git init # Initialize git repository
git remote add origin https://your-repo-url.git # Add remote repository
git checkout -b your-branch-name # Create and switch to branch
git add .  # Stage all files
git commit -m "Initial commit" # Commit changes
git push -u origin your-branch-name  # Push branch to remote

Tag Management

Creating Tags

git tag v1.0.0  # Create lightweight tag
git tag -a v1.0.0 -m "Release version 1.0.0"  # Create annotated tag with message
git tag v1.0.0 commit-hash  # Tag specific commit

Pushing Tags

git push origin v1.0.0  # Push single tag
git push origin --tags  # Push all tags

Managing Existing Tags

git tag -d old-tag-name   # Delete local tag
git push origin --delete old-tag-name  # Delete remote tag
git tag new-tag-name old-tag-name  # Rename tag (delete old, create new)
git tag -d old-tag-name
git push origin --delete old-tag-name
git push origin new-tag-name

Branch and Tag Relationship

Key Points: - Tags point to specific commits, not branches - Tags are created on the current HEAD commit - Use git branch --contains tag-name to see which branches contain a tag

Best Practices

git checkout main
git tag v1.0.0
git push origin v1.0.0
git show v1.0.0  # Check tag location
git branch --contains v1.0.0

Common Workflow Example

git init  # 1. Setup project
git remote add origin https://repo-url.git

git checkout -b feature/new-functionality # 2. Create feature branch

git add . # 3. Work and commit

git commit -m "Add new functionality" git push -u origin feature/new-functionality # 4. Push branch

git checkout main # 5. Merge to main and tag release git merge feature/new-functionality git tag v1.0.0 git push origin main git push origin v1.0.0

Useful Commands

git branch -a  # List all branches
git tag -l  # List all tags
git show tag-name  # View tag details
git branch --show-current  # Check current branch

Tags are essential for marking release points and maintaining version history, while branches organize development work efficiently.

相关标签
Git
About Me
XD
Goals determine what you are going to be.
Category
标签云
Pickle Agent Cloudreve SPIE Proxy Ubuntu BTC 图形思考法 Python MD5 Conda 云服务器 HaggingFace 音频 uWSGI Use Ptyhon torchinfo 版权 Data XGBoost AI Algorithm Numpy 净利润 第一性原理 关于博主 Plotly v0.dev UNIX TSV Quantization SVR Bipartite 搞笑 TTS Animate Miniforge scipy Quantize Diagram CUDA CSV FP16 Michelin Github Transformers Docker tar Llama VGG-16 CC Magnet Datetime JSON Hotel IndexTTS2 RGB LLAMA QWEN Pytorch Statistics Sklearn Django SQLite Review Attention Disk Template RAR Paper LoRA Image2Text LaTeX Hilton FastAPI tqdm TensorRT 证件照 Google VPN HuggingFace 顶会 DeepStream VSCode OpenCV CV FP64 Tensor hf Breakpoint Anaconda OCR Plate YOLO Password PDF Qwen2 腾讯云 Mixtral Video OpenAI C++ 算法题 git WebCrawler LeetCode git-lfs 递归学习法 公式 Qwen2.5 FP8 ChatGPT XML uwsgi FlashAttention Knowledge PDB Clash 飞书 Jupyter 签证 域名 Random logger News Paddle Translation SAM Baidu v2ray Website COCO Pillow 多线程 PyTorch NLTK Web CLAP Domain Dataset 阿里云 GoogLeNet Bin Card ModelScope CTC GGML Crawler BF16 Hungarian Interview mmap Color GPT4 Freesound Windows transformers Zip WAN 报税 Heatmap CEIR GIT Streamlit Bert llama.cpp SQL PIP GPTQ Base64 Bitcoin ONNX 强化学习 Distillation Shortcut Qwen EXCEL Git Claude API Vim Safetensors UI DeepSeek FP32 NameSilo CAM ResNet-50 Linux Augmentation TensorFlow BeautifulSoup PyCharm Logo Firewall 财报 Tracking Math Permission NLP Gemma InvalidArgumentError diffusers printf Land Tiktoken Search Vmess Pandas LLM 继承 Nginx 多进程 Food Jetson Input Markdown Excel
站点统计

本站现有博文321篇,共被浏览763840

本站已经建立2439天!

热门文章
文章归档
回到顶部