git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Working from different machines.

From
TTobiah <toby@tobiah.org>
Date
Aug 18, 2016, 14:28 UTC
Message-ID
<4a154cc2-c3e2-65b7-4bdd-d7c41d700491@tobiah.org>
In-Reply-To
<60d5e760-dbc9-121e-f003-a6971534cdcb@gmail.com>
>
> * First, `--mirror` might be what the relation between 'desktop'
>   and 'home' repositories should be.
>
Here's what I'm trying, am I in the right ballpark?
desk> git branch
* master
desk> git checkout -b banana
Switched to a new branch 'banana'
desk> echo 'message' > oracle
desk> git add oracle
desk> git commit -a -moracle
[banana 66e7823] oracle
  1 file changed, 1 insertion(+)
  create mode 100644 oracle
desk> git push --mirror
Counting objects: 3, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 260 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
To toby@shells.rcsreg.com:/home/git/toby/exposmart
  * [new branch]      banana -> banana
# Then on another machine:
home> git branch
* master
## Forgot to 'pull' here, but it never shows new branches anyway
## I have to get them by name.  Can I automate that?
home> git checkout banana
Branch banana set up to track remote branch banana from origin.
Switched to a new branch 'banana'
home> cat oracle
message
home> echo 'other message' >> oracle
home> git commit -a -moracle2
[banana 78e6c45] oracle2
  1 file changed, 1 insertion(+)
home> git push --mirror
Counting objects: 36, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (22/22), done.
Writing objects: 100% (36/36), 2.90 KiB | 0 bytes/s, done.
Total 36 (delta 13), reused 14 (delta 4)
To shells.rcsreg.com:/home/git/toby/exposmart
    66e7823..78e6c45  banana -> banana
    7e01bf8..c65ed75  origin/HEAD -> origin/HEAD
  * [new branch]      origin/auto -> origin/auto
  * [new branch]      origin/banana -> origin/banana
  * [new branch]      origin/develop -> origin/develop
  * [new branch]      origin/flipper -> origin/flipper
  * [new branch]      origin/tart -> origin/tart
home> vi
home> git push --mirror
Total 0 (delta 0), reused 0 (delta 0)
To shells.rcsreg.com:/home/git/toby/exposmart
    66e7823..78e6c45  origin/banana -> origin/banana
home> git push --mirror
Everything up-to-date
home>

## Why do I have to push three times to get the 'Everyting up-to-date' ## message? Why does it still mention 'flipper' and 'tart' and all ## other branches I've played with. When I delte them locally, I want ## them to be deleted everywhere. They just keep accumulating. ## ## Now back a the other machine

desk> git pull
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
 From shells.rcsreg.com:/home/git/toby/exposmart
    66e7823..78e6c45  banana     -> origin/banana
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
     git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
     git branch --set-upstream-to=origin/<branch> banana
desk> git branch
* banana
   master
desk> git pull origin banana
 From shells.rcsreg.com:/home/git/toby/exposmart
  * branch            banana     -> FETCH_HEAD
Updating 66e7823..78e6c45
Fast-forward
  oracle | 1 +
  1 file changed, 1 insertion(+)
desk> cat oracle
message
other message

## So it seems to have worked, but the more I go back and forth ## The more I seem to have eventual problems getting branches ## and changes. Am I doing it right?

Thanks
Previous: Jakub NarębskiNext: Jakub Narębski
Message 5 of 7 in “Working from different machines.”
  1. TobiahAug 17, 2016
  2. Junio C HamanoAug 17, 2016
  3. Jacob KellerAug 18, 2016
  4. Jakub NarębskiAug 18, 2016
  5. TobiahAug 18, 2016
  6. Jakub NarębskiAug 18, 2016
  7. TobiahAug 18, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.