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

本站现有博文336篇,共被浏览946413

本站已经建立2657天!

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