S
S
Sergey2015-06-16 01:23:48
git
Sergey, 2015-06-16 01:23:48

How to upload your changes to a separate git branch?

There is a repository on github. I created a new-design branch in the web interface. There is a project with a new design on the server. On the server, git is not initialized. I need to initialize it so as not to overwrite anything, upload the changes to the new-design branch on the github.
Is my logic correct, I want to do this:
1. On the server, I do git --init origin in the project folder
2. I upload everything to github git push origin new-design githuburl
Will I get what I want? won't mess anything up?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2015-06-25
@butteff

In general, I solved the problem like this:
1. Created a branch on github through the web interface
2. Created a git repository with the git init
command 3. Added a remote repository with the command git remote add github link to github , where github is the name of the remote repo, I called github, it's more convenient and understandable for me.
4. created a branch for myself, named it the same as on the github in paragraph 1. The command git checkout -b branch name
5. In this branch, I added files to upload: git add files
6. Committed them: git commit
7. Made a pull request : git pull github
8. Pushed my branch to the github branch on the server: git push github branch name(branch names must be the same)

E
evnuh, 2015-06-16
@evnuh

clones the github repo to the server, checkout the branch, throw all your files into the repo folder, commit, push.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question