Skip to content
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

Support for remote management in git #60640

Merged
merged 10 commits into from
Mar 8, 2019
Merged

Conversation

manjrekarom
Copy link
Contributor

Added options for adding and removing remotes.

@msftclas
Copy link

msftclas commented Oct 11, 2018

CLA assistant check
All CLA requirements met.

@joaomoreno joaomoreno added this to the Backlog milestone Oct 11, 2018
@joaomoreno joaomoreno added the git GIT issues label Oct 11, 2018
@balexandre
Copy link

balexandre commented Oct 12, 2018

@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
Contributor Author

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

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

@balexandre
Copy link

@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
Member

Feel free to add that to this PR

@jongio
Copy link

jongio commented Dec 9, 2018

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

@manjrekarom
Copy link
Contributor Author

@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

jongio commented Dec 9, 2018

@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
Copy link
Contributor Author

manjrekarom commented Dec 9, 2018

@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

jongio commented Dec 9, 2018

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
Contributor Author

@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

jongio commented Dec 9, 2018

@manjrekarom - :shipit:

@kinghat
Copy link

kinghat commented Dec 14, 2018

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] [( | )…​]

@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

jongio commented Dec 14, 2018

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

@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

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

@joaomoreno
Copy link
Member

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

@joaomoreno joaomoreno merged commit 0e3cd12 into microsoft:master Mar 8, 2019
@joaomoreno joaomoreno modified the milestones: Backlog, March 2019 Mar 8, 2019
@jongio
Copy link

jongio commented Mar 8, 2019

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

@alexanderlsmith123
Copy link

Yeah this is awesome

@manjrekarom
Copy link
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

jongio commented Mar 9, 2019

@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.

None yet

8 participants