I am very new to git. I am working with a remote repo. I set up my my working environemnt like this:
git clone git@... /folder/
git branch -v
# origin git@... (fetch)
# origin git@ ... (push)
git branch someLocalBranch
What would I do if I want to pull changes from the remote master
into my local master
? And, how would I go on about pushing
changes from someLocalBranch
into a remote branch
? That remote branch
can either exist, or does not exist yet.
To pull changes from remote master to your local master, checkout master
on your local
git checkout master
and then pull the diff using -
git pull origin master
To push changes from someLocalBranch
, commit all your changes while you are on the branch
git commit -a -m "message for commit"
and push them to remote
git push origin someLocalBranch
Now you can raise a Pull Request from this branch to any existing in the repository. Look here for more documentation on that.
To push changes from one branch to another, try using
git push origin someLocalBranch:someRemoteBranchABC
Do take a look at detailed answer here.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments