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

feat(gitTrick): Add another nice git trick I learned recently #163

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

neumantm
Copy link
Contributor

@neumantm neumantm commented Dec 8, 2022

Description

Add another nice git trick I learned recently: Automatically setting the upstream branch when pushing new branches.

Checklist

  • I made sure that the markdown files are formatted properly.
  • I made sure that all hyperlinks are working.

@@ -55,6 +58,7 @@

What does it do?

- When pushing new branches, automatically set the upstream branch to a branch with the same name on the primary remote
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This I don't understand. Isn't this done anyway?

git push -u origin new_branch

Or does this mean I don't have to use the -u flag?

Copy link
Contributor Author

@neumantm neumantm Dec 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this automatically sets the upstream (what is done manually with -u).
This means you can use git push if you want to push the current branch.

@uekerman uekerman self-assigned this Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants