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

本站现有博文309篇,共被浏览735823

本站已经建立2373天!

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