First, when you create a branch, do so with git switch: git switch -c test origin/master, preferably after a git fetch (in order for origin/master to reflect the latest commit pushed there)
Then make sure your first push is git push -u origin test in order to establish a remote tracking branch origin/test, which will facilitate the subsequent pushes to that branch.
When you colleague do a git switch test (after a fetch), the default guess mode automatically establish a remote tracking branch (as if they typed git switch -c <branch> --track <remote>/<branch>)
That is why a simple git pull would be enough to update their local test branch after your step 5.
github - Git pull command - Stack Overflow
request-pull - how it works?
version control - How do I git pull a dev branch? - Drupal Answers
is git pull not recommended?
First, when you create a branch, do so with git switch: git switch -c test origin/master, preferably after a git fetch (in order for origin/master to reflect the latest commit pushed there)
Then make sure your first push is git push -u origin test in order to establish a remote tracking branch origin/test, which will facilitate the subsequent pushes to that branch.
When you colleague do a git switch test (after a fetch), the default guess mode automatically establish a remote tracking branch (as if they typed git switch -c <branch> --track <remote>/<branch>)
That is why a simple git pull would be enough to update their local test branch after your step 5.
The only way to do this is, as suggested by @larsks, to issue a git pull.
Instead, if anybody need to inspect changes before pulling them, he can:
git fetch --all
git diff HEAD..origin/<BRANCH-NAME>
I want to do pull requests using `git request-pull`. I checked the documentation https://www.git-scm.com/docs/git-request-pull and tried to follow the example it described. The problem is - things do not seem to work. First thing which is problematic - the page talks about releases. I cannot find any resources about "releases".
This is what I did so far:
git commit -m "first commit" git push -u origin main git branch dupa git checkout dupa git add . git commit -m "added a file" git push -u origin dupa
Now I can see both branches and a new file in the dupa branch. Next thing I tried:
git request-pull dupa https://github.com/jakubiszon/test-repo main
The output was:
The following changes since commit bf4aa4fd1b4a217542cd28955b20b86ddfb26cb6: first commit (2020-10-22 18:18:57 +0200) are available in the Git repository at: https://github.com/jakubiszon/test-repo main for you to fetch changes up to bf4aa4fd1b4a217542cd28955b20b86ddfb26cb6: first commit (2020-10-22 18:18:57 +0200)
I am not sure what I did wrong. Both branches contain all relevant commits. Or don't they?
If I do
git clone --recursive --branch 7.x-3.x http://git.drupal.org/project/views.git
and then
git branch -r
I get
origin/4.6.x-1.x
origin/4.7.x-1.x
origin/5.x-1.x
origin/6.x-2.11-security
origin/6.x-2.x
origin/6.x-3.x
origin/7.x-3.x
origin/8.x-3.x
origin/HEAD -> origin/7.x-3.x
origin/d7v3ui
origin/master
I believe you need the recursive flag to get all remotes. Not sure if you did that, but a quick git fetch will update your list of remotes.
git pull origin 7.x-3.x-dev
fatal: Couldn't find remote ref 7.x-3.x-dev
Unexpected end of command stream
I think this is just due to the naming conventions, current dev is HEAD afaik.
git pull origin 7.x-3.x
From http://git.drupal.org/project/views
* branch 7.x-3.x -> FETCH_HEAD
Already up-to-date.
I believe that any branch (not tag) can be considered 'dev' for that drupal version.
Hope this helps.
I'm not a Git expert, but as I understand it all of the releases of the dev branch listed on the project page are made directly to the 7.x-3.x branch. Of course you're free to create your own branches locally for your own needs, but the master-like branch, which includes all of the releases pushed to drupal.org, is always going to be that 7.x-3.x branch.
If you want to switch to one of the tagged releases, use git tag to get a list of all the releases. Then, to check out the 7.x-3.1 release (for example), use git co 7.x-3.1.
If you intend to edit the code for this release, you can then create a new branch (as Git explains) by using git checkout -b mycustombranch.