Skip to content

Support for remote management in git - #60640

Merged
João Moreno (joaomoreno) merged 10 commits into
microsoft:masterfrom
manjrekarom:master
Mar 8, 2019
Merged

João Moreno (joaomoreno) merged 10 commits into
microsoft:masterfrom
manjrekarom:master

Conversation

@manjrekarom

Copy link
Copy Markdown
Contributor

Added options for adding and removing remotes.

@msftclas

Microsoft Contribution License Agreements (msftclas) commented Oct 11, 2018 •

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

@joaomoreno João Moreno (joaomoreno) added this to the Backlog milestone Oct 11, 2018
@joaomoreno João Moreno (joaomoreno) added the git GIT issues label Oct 11, 2018
@balexandre

Bruno Alexandre (balexandre) commented Oct 12, 2018 •

Copy link
Copy Markdown

Omkar Manjrekar (@manjrekarom) if it's not much to ask, can you add "Prune/Purge Remote Branches" option as well ?

git remote prune <remote_name>

@manjrekarom

Copy link
Copy Markdown
Contributor Author

Bruno Alexandre (@balexandre) Yes. I will be happy to add that as well. But do I need to get a confirmation first?

João Moreno (@joaomoreno) Should I create a different pull request or add it here? Sorry, I am kinda new to this stuff. Thanks!

@balexandre

Copy link
Copy Markdown

Omkar Manjrekar (@manjrekarom) that will depend if there's more than one remote, and you only prune the one set as upload stream...

would be useful to have it as well, like git fetch to continue in the background and purge it time to time, as all it does is remote the remotes, not local branchs ... organizations tend to have the remote clean up time to time, and I'm facing that every time they simply forget :)

I also use this snipped to get all remotes from each author (so I know what they need to clean up)

git for-each-ref --format='%(committerdate)%09%(authorname)%09%(refname)' | sort -k5n -k2M -k3n -k4n | grep remotes | awk -F "\t" '{ printf "%-32s %-27s %s\n", $1, $2, $3 }'

@joaomoreno

Copy link
Copy Markdown
Contributor

Feel free to add that to this PR

@jongio

Copy link
Copy Markdown

Omkar Manjrekar (@manjrekarom) - would love to see this get implemented. Are you still working on it? Need help?

@manjrekarom

Copy link
Copy Markdown
Contributor Author

Jon Gallant (@jongio) I am almost forgot about that. Will start working on the purge/prune thing. I'll let you know if I need any help. Thanks for asking.

@jongio

Copy link
Copy Markdown

Omkar Manjrekar (@manjrekarom) What are your thoughts on doing it as a separate PR instead of merging it with this one… That way we can get the baseline remote stuff in there and then add prune later on?

@manjrekarom

Omkar Manjrekar (manjrekarom) commented Dec 9, 2018 •

Copy link
Copy Markdown
Contributor Author

Jon Gallant (@jongio) Yeah. That is fine to me. Priority stuff should be added first.

I've done add and remove remote. Can you tell me what more should go into the baseline?

@jongio

Copy link
Copy Markdown

How about adding a command to view the remotes - git remote -v and then that hows the remote in the dropdown or output pane?

@manjrekarom

Copy link
Copy Markdown
Contributor Author

Jon Gallant (@jongio) Yes, I'll add that in this PR.

Here is a list of all remote things from git scm. I've tried categorising them. Let me know what you think.

Baseline:

  1. git remote [-v | --verbose]
  2. git remote rename

Extra

  1. git remote set-head (-a | --auto | -d | --delete | )
  2. git remote set-branches [--add] …​
  3. git remote get-url [--push] [--all]
  4. git remote set-url [--push] []
  5. git remote set-url --add [--push]
  6. git remote set-url --delete [--push]
  7. git remote [-v | --verbose] show [-n] …​
  8. git remote prune [-n | --dry-run] …​
  9. git remote [-v | --verbose] update [-p | --prune] [( | )…​]

@jongio

Copy link
Copy Markdown

@kinghat

Copy link
Copy Markdown

Here is a list of all remote things from git scm. I've tried categorising them. Let me know what you think.

Baseline:

  1. git remote [-v | --verbose]
  2. git remote rename

Extra

  1. git remote set-head (-a | --auto | -d | --delete | )
  2. git remote set-branches [--add] …​
  3. git remote get-url [--push] [--all]
  4. git remote set-url [--push] []
  5. git remote set-url --add [--push]
  6. git remote set-url --delete [--push]
  7. git remote [-v | --verbose] show [-n] …​
  8. git remote prune [-n | --dry-run] …​
  9. git remote [-v | --verbose] update [-p | --prune] [( | )…​]

Omkar Manjrekar (@manjrekarom) would these be the main ones to be added?
git remote add upstream, git fetch upstream, and git rebase upstream/master or git merge upstream/master

@jongio

Copy link
Copy Markdown

Great point. It would be awesome if I could have a 'rebase with remote' feature, but I think that is prob a diff PR.

@darkyuhoo01

Copy link
Copy Markdown

Jon Gallant (@jongio) Yes, I'll add that in this PR.

Here is a list of all remote things from git scm. I've tried categorising them. Let me know what you think.

Baseline:

git remote [-v | --verbose]
git remote rename
Extra

git remote set-head (-a | --auto | -d | --delete | )
git remote set-branches [--add] …​
git remote get-url [--push] [--all]
git remote set-url [--push] []
git remote set-url --add [--push]
git remote set-url --delete [--push]
git remote [-v | --verbose] show [-n] …​
git remote prune [-n | --dry-run] …​
git remote [-v | --verbose] update [-p | --prune] [( | )…​]

@darkyuhoo01

Copy link
Copy Markdown

Omkar Manjrekar (@manjrekarom) - would love to see this get implemented. Are you still working on it? Need help?

@joaomoreno

Copy link
Copy Markdown
Contributor

Apart from the error of sanitizing the remote URL, looks great, thanks!

@joaomoreno
João Moreno (joaomoreno) merged commit 0e3cd12 into microsoft:master Mar 8, 2019
@jongio

Copy link
Copy Markdown

Awesome! Rachel Macfarlane (@RMacfarlane) - It would be awesome to see how we integrate the PR extension docs with this update.

@alexanderlsmith123

Copy link
Copy Markdown

Yeah this is awesome

@manjrekarom

Copy link
Copy Markdown
Contributor Author

Thank you so very much everyone! :D Delighted to see my PR go into master. I started working on this as a Hacktoberfest task and never imagined it would go this way. This will be my first (real) accepted PR. And that too for something that I and millions of people enjoy using daily. Thanks again.

@jongio

Copy link
Copy Markdown

Omkar Manjrekar (@manjrekarom)

That’s awesome. Thank you so much for the effort.

@github-actions github-actions Bot locked and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

git GIT issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants