Git has been introduced on a project, after I've been working on it for a bit.
Now there's a local git server, which hosts the base code, I've been working with and modified.
Now I need to create a new branch on the server, which features the modifications I made.
My plan is to pull(?) the current git repository to a new folder, copy over all the content - which I've been managing locally, then create a new branch locally and push(?) it again onto the server.
This would leave me with a new branch, which I can modify locally and push onto the branch on the server, is that correct?
mkdir project_git && cd project_git git pull <remote> git checkout -b my_changes cp project project_git git add -A git commit -m "new branch with local changes" git push origin my_changes
Is this the "correct" way to handle the situation? What commands would I need to use for this?
Creating a new branch for git server, you can
clone the repo in another directory (if you have local repo, you can
pull directly), and switch to a new branch locally and finally
push to the git server. Detail steps as below:
# In another directory git clone /path/for/git/server cd repo git checkout -b newBranch # make changes git add . git commit -m "message" git push origin newBranch