Working with remote repo git

Stophface

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.

Naman

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Git clone remote repo into another remote repo

From Dev

git sparseCheckout repo pushes full repo to remote

From Dev

Push git alias to remote repo

From Dev

Git remote repo, not showing the files

From Dev

Failure to push to remote repo in Git

From Dev

feasibility of git without a remote repo

From Dev

Error Pushing to Remote Git Repo

From Dev

Git remote repo, not showing the files

From Dev

feasibility of git without a remote repo

From Dev

Git remote repo no showing in <ul>

From Dev

Git: Best way to manage multiple working copies of a single repo with third-party remote?

From Dev

Creating a working copy of a GIT repo

From Dev

Visual Studio 2013 Configure Remote Git Repo

From Dev

How do determine the URL of a remote git repo?

From Dev

How to compare local with remote git repo in PhpStorm?

From Dev

Force a certain version of git on push to remote repo

From Dev

Check if local git repo is ahead/behind remote

From Dev

When a commit was pushed into a remote Git Repo

From Dev

How to cleanup garbage in remote git repo

From Dev

Git status - Not showing states of remote Repo

From Dev

List branches of a git remote repo without cloning it

From Dev

Is git stash stack pushed to the remote repo?

From Dev

Track existing folder from remote git repo

From Dev

Adding svn-remote to existing git repo

From Dev

Add subdirectory of remote repo with git-subtree

From Dev

Adding a Remote to a Git Repo Owned by Someone Else

From Dev

Fetch specific commit from remote git repo

From Dev

Merge local git repo with remote one

From Dev

Git: How to remove secondary remote repo