-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Worktree aliases #104
base: main
Are you sure you want to change the base?
Worktree aliases #104
Conversation
I noticed after pushing up to github the README.md didn't have my updates so I linked to doc/index.md so there is only one source of truth
Great, thank you! Worktree is a super command for easy experimentation. A few questions for you...
If you would like to fix up your merge request, that's great. Pull rebase (because there's a fix that came it just today for a bunch of quotations), then push any of the changes you want to do above. Or if you prefer to have me to do it, that's fine too; I'm so grateful for your code. Thank you so much, again, for all your additions. These will be really useful for many people and teams. And I especially appreciate that your doing the doc, links, etc. that make it easier for people to use. |
Co-authored-by: Lorenz Leutgeb <lorenz.leutgeb@gmail.com>
Co-authored-by: Lorenz Leutgeb <lorenz.leutgeb@gmail.com>
Co-authored-by: Lorenz Leutgeb <lorenz.leutgeb@gmail.com>
Co-authored-by: Lorenz Leutgeb <lorenz.leutgeb@gmail.com>
Co-authored-by: Lorenz Leutgeb <lorenz.leutgeb@gmail.com>
Sorry it took me a while to get back I was on mini vacation with grand kids. wtd was chosen for 'worktree remove' because worktree has a repair option which would conflict with wtr so I chose wtd for remova and it has same concept and doesn't conflict with wtr for worktree repair. As you pointed out wtu is missing an assignment it should be wtu = worktree unlock do you want an other pull request with the correction |
Thanks for the new info. I believe that you're able to push a correction for wtu into this pull request, and also revert the README deletion, and then this PR is good to merge. (Or if you prefer, I can do all that for you) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gitalias.txt
in the base branch is outdated.
@@ -485,59 +513,59 @@ | |||
add-alias = "!f() { \ | |||
if [ $# != 3 ]; then \ | |||
echo \"Usage: git add-alias ( --local | --global ) <alias> <command>\"; \ | |||
echo \"Error: this command needs 3 arguments.\"; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't forget to update your base branch, so that it is at or ahead of 95d5fda.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... and as of now it should be at or ahead of 12c40fc. There are conflicts to resolve now anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unresolved this conversation, as I do still see unexpected/unrelated changes in gitalias.txt
even after @dabrown645's merge commit ca6abe3.
If you prefer me to add the aliases for you, rather than trying to do this pull requests, let me know. This is because this pull request is a bit more complex than a typical one would be, because the .gitconfig file is large, and there are significant changes happening this week, so your changes are being blocked by the newer changes. Happy to explain more if that could be helpful for you. |
I understand there is a lot going on with gitalias and if it is easier for you to add the wortree aliases then trying to do this pull request I am ok with that. Have you thought about breaking gitalias up into 2 pieces that could be included one with the aliases and one with the workflow. This would make it the configuration cleaner if someone chooses a different workflow or no aliases for workflow. I have noticed some issues with my workflow and using worktrees that I am working through now. |
Thank you. I'll proceed with this.
Yes. Some teams really like this approach because it's flexible. Other teams really dislike this approach because they have to track multiple files. What seems to satisfy both kinds of teams, in practice, is for them to use gitalias.txt as one big starter file, then write team-specific overrides in their own separate files.
Can you say more about this? |
First let me confess I am not a git expert I am a retired system administrator and used get to keep some control the scripts that automated a lot of the work I did. I have worked with development teams and their various workflows but never quite settled on one for my stuff. I think my issues with worktrees is the way I set them up. I followed some guidance to manage directory chaos using bare repository (https://morgan.cugerone.com/blog/how-to-use-git-worktree-and-in-a-clean-way/). When I tried creating a pull for this changed I ran into anther problem . I cloned with the bare repository did wta main and changed into it to add remote tracking it didn't work. I figured out that if I went into the bare repo and add remote tracking it worked. Right now I don't know if there are any other issues I will run into or if I need to make a change to the way I set up my clone. |
Good info and context, thank you. Git worktrees and bare repos are great features. They do tend to make things more complex. For example, in 100+ teams where I've used git, only 1 team is using worktrees and bare repos regularly. Nearly all the other teams do typical work on one branch, and use stash in the rare case it's needed (as the article you sent describes). A handful of teams prefer to do a "wip" commit, meaning "work in progress"; later on, when a teammate decides to work on that branch again, then the teammate amends the commit with more work and a better commit message, or does more commits then squashes. |
I have started using worktrees on my projects and put together some basic aliases for entering worktree subcommands so I thought I would contribute them to this package.
I noticed after initial push that README.md didn't have my updates and doc/index.md did so this adds link for README.md to doc/index.md along with the other changes.