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

本站现有博文338篇,共被浏览966769次

本站已经建立2679天!

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