I guess you haven't yet grasped the full effects of the decentralised 
nature of Git yet ;-)
When you 'pull' you first 'fetch' the [selected branches of the] remote 
repository and store it under the remote's name (often 'origin'),
so you get an 'origin/master' (as well as your own 'master'), and then the 
second part of the 'pull' comes into play, and for most it's a 'merge' 
(config options available), and for newbies that's commonly a simple fast 
forward merge, so your master is advanced to point at the same commit that 
origin/master points at.

However if your [implicit / configurable] selection for the fetch also 
fetched the "new" branch it will also be in the local copy of the remote 
(tracking branch) called 'origin/new' which isn't yours yet. 

If you use the -a option for the branch command you will then see all those 
other 'remotes/' branches which you should never checkout directly (at 
least not until you know how to run & juggle scissors). Though what you are 
likely to do is instead use the branch command to start a fresh personal 
branch (with the name you want to use: my_new) starting at the origin/new 
starting point. This will mean that you can do as you wish with your 
version without compromising the copy of what's on the "server" [but start 
to think 'remote', as you can also have colleagues as remotes].

Hope that helps you unpick the mental model of a *D*VCS.



On Thursday, September 28, 2023 at 2:07:03 PM UTC+1 
leonardo....@logintranet.com wrote:

> Good afternoon everyone,
> I'm a bit new of Git mechanisms and commands so maybe this topic can be 
> already discussed.
>
> Practically, I see that once a branch has been created remotely from 
> 'master' (eg. directly from Atlassian JIRA through 'Create branch'), 
> performing a 'git pull' command on the 'master' branch correclty download 
> the new branch from the remote repository.
>
> However, if we perform the "git branch" command from master after the 
> pull, the new branch is not listed into the branches available on the 
> project.
>
> Once we check out the new branch, if we execute "git branch" command again 
> the new branch appears in the list..
>
> In my opinion, It would be quite useful if the new branch displays in the 
> list once it's been synchronized with 'pull' command.
> Can it be a bug or a desired behaviour?
>
> Let me know what you think about that, thanks in advance :)
> Leonardo D'Alimonte
> Loginet srl
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/e1df8d07-f37f-4d2e-87a1-cc5a3e4d75a9n%40googlegroups.com.

Reply via email to