I am new to git.
I have done a clone of remote repo as follows
git clone https://[email protected]/repo.git
then I did
git checkout master
made some changes and committed these changes to my local repository like below..
git add .
git commit -m "my changes"
Now I have to push these changes to the remote repository.
I am not sure what to do.
Would I do a merge of my repo to remote ?
what steps do I need to take ?
I have git bash and git gui.
Please advise.
To push the commit from the local repo to your remote repositories, run git push -u remote-name branch-name where remote-name is the nickname the local repo uses for the remote repositories and branch-name is the name of the branch to push to the repository. You only have to use the -u option the first time you push.
Push a new Git branch to a remote repo Clone the remote Git repo locally. Create a new branch with the branch, switch or checkout commands. Perform a git push with the –set-upstream option to set the remote repo for the new branch. Continue to perform Git commits locally on the new branch.
Commit the files staged in your local repository by writing a commit message. You can create a commit message by git commit -m 'your message' , which adds the change to the local repository.
To push the new commit onto the remote, you need to click on the push button again. Then, click push once more. That's it. Once the commit is pushed to the remote branch, you can see that the origin/master tag gets moved to the same commit as the master tag.
All You have to do is git push origin master
, where origin
is the default name (alias) of Your remote repository and master
is the remote branch You want to push Your changes to.
You may also want to check these out:
You just need to make sure you have the rights to push to the remote repository and do
git push origin master
or simply
git push
git push
or
git push server_name master
should do the trick, after you have made a commit to your local repository.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With