The code base for the GIT section of the wizard / function

This is probably one of the stupidest questions I asked. I am trying to use Git for a project set up by someone else. I pulled the master branch from the remote repository, and I forked it to my branch.

The question is, I still see only one code base. Do I use Git Bash to switch to my user branch and work with the same code base? I just do not understand this concept, because I'm used to seeing different code bases for different branches.

I use the Git command window to switch branches, continue to work on the code base that I received when I cloned the repository, and then when I finish, will I combine it with my "local" wizard before clicking on the remote?

I got it right? Thank you in advance.

0
source share
2 answers

(in all the examples below, foo is the name of the branch)

You only see the code for the branch you are currently in. To view a list of branches, type

git branch 

To switch to another branch, enter:

 git checkout foo 

To remove a branch, enter:

 git branch -D foo 

To merge two branches, go to one of them, then enter:

 git merge foo 

The idea is that you only see the code that currently matters (the branch you are working on). I find the Github.com tutorial on Git to be pretty clear. Another good resource is the Git Community Book .

One important note: when you pull from a remote repository, you only pull the wizard branch by default. If you want to pull other branches, you will need to specify them directly.

+2
source

Git branching is pretty confusing for beginners.

You see only one code base right now, because your two branches are exactly the same.

Use 'git checkout' to switch to another branch. Now the source code in your file system will change to another branch. If you have not made any changes, it will look the same.

If you are confused as to which branch you are in, run 'git branch' with no parameters and it will display all branches with the current branch with an asterisk.

Here is more info. http://gitref.org/branching/

+2
source

All Articles