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

本站现有博文327篇,共被浏览833476

本站已经建立2538天!

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