
If you can't currently push, use git branch -set-upstream-to=origin/$(git branch -show-current). You can also run git push -u another time if you accidentally created a remote branch, but forgot to setup tracking. To create a branch with the same name on the remote and setup tracking, use the -u option: git push -u That means git pull won't work, and Git won't notify you when your local and remote branches differ. While that is usually what you want, it does not setup tracking between your local and remote branches. However, it has a small side effect: When a branch with your local name does not exist on your remote, it automatically creates it on the remote.

Caveat with currentįor most of us, current is the safest push behavior. Regardless which option you use you can manually do a git push origin my-branch to explicitly push only your current branch. Since it's hard to remember which project behaves how, you should find a suitable global setting. Mind that omitting the -global flag only changes it for the current repository. It’s worth mentioning that this changes all your remote-tracking branch names, too. For instance, if you want to rename pb to paul, you can do so with git remote rename: git remote rename pb paul git remote origin paul. So to change that to push only current branches, just go ahead and say: git config -global fault current You can run git remote rename to change a remote’s shortname. By default, it will return matching (see above). If you want to check your setting, do the following.

upstream - push the current branch to its upstream branch.All branches having the same name in both ends are considered to be matching. matching - push all matching branches.Prevents you from data breaches and liability risksįrom the git-config documentation Show snapshot:ĭefines the action git push should take if no refspec is given on the command line, no refspec is configured in the remote, and no refspec is implied by any of the options given on the command line.Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)
