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

本站现有博文333篇,共被浏览922500

本站已经建立2628天!

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