Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5980201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:46:03+00:00 2026-05-22T21:46:03+00:00

If I do $ git branch a $ git checkout a Switched to branch

  • 0

If I do

$ git branch a
$ git checkout a
Switched to branch 'a'
$ git branch b
$ git checkout b
Switched to branch 'b'
$ git branch c1
$ git branch c2

Is there any relationship between these branches, or are there all considered ‘flat’ because there weren’t any commits in them? In SVN, I would model these branches like this:

master
|
+-a
  |
  +-b
    |
    +-c1
    |
    +-c2

However, when I try to follow this question and do gitk master a b c1 c2, I get a flat line, not the diagram I put above.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:46:04+00:00Added an answer on May 22, 2026 at 9:46 pm

    git doesn’t have a strict parent branch, it just has a particular commit path. In this case, they all have the same commit as their starting point, so they’re all the same. As soon as they start having their own commits, they’ll be their own “lines”, but they won’t really have a relationship to one-another.

    At any point though you can easily merge with any branch using git merge, so the “parent” relationship isn’t all that fundamental. Git does have the concept of a parent for the case of using --track (where you receive your parents commits), but this is just a special convenience function. You could easily have any number of “parents” if you dot your I’s and cross your T’s (git merge branch A, git merge branch B, etc).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I did: git checkout sign-up And got this: M Gemfile Switched to branch 'sign-up'
I have a branch called experiment. git checkout master echo 'some changes' > a.txt
Is there a Git command equivalent to: git branch | awk '/\*/ { print
Right now, when I type git branch it lists my branches in an arbitrary
When I checkout, I get: me@localhost# git checkout master D deps/example M deps/example2 Switched
I have a file, foo.txt Create and checkout branch 'branch_A' git mv foo.txt bar.txt
I was on the master branch, and I ran git checkout -b ui .
In my current repo I have the following output: $ git branch -a *
The command to remove a remote branch in git is the following git push
Here's an example: >git status # On branch master nothing to commit (working directory

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.