Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

git-branch

How do I clone a specific Git branch? [duplicate]

August 20, 2022 by Tarik

git clone -b <branch> <remote_repo> Example: git clone -b my-branch git@github.com:user/myproject.git With Git 1.7.10 and later, add –single-branch to prevent fetching of all branches. Example, with OpenCV 2.4 branch: git clone -b opencv-2.4 –single-branch https://github.com/Itseez/opencv.git

Categories git Tags git, git-branch, git-clone Leave a comment

Make an existing Git branch track a remote branch?

August 20, 2022 by Tarik

Given a branch foo and a remote upstream: As of Git 1.8.0: git branch -u upstream/foo Or, if local branch foo is not the current branch: git branch -u upstream/foo foo Or, if you like to type longer commands, these are equivalent to the above two: git branch –set-upstream-to=upstream/foo git branch –set-upstream-to=upstream/foo foo As of … Read more

Categories git Tags branch, git, git-branch Leave a comment
Newer posts
← Previous Page1 … Page21 Page22

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa