How to create a new branch based on an existing Git node branch? (Please read - tried the beginners guide)

I have a master branch and you want to create a new branch on it, and then switch to a new branch.

I am very new to coda / github / terminal, so I don’t even know if the syntax is correct. here, what I typed is the letter for the letter, with the exception of the names of the branches that are placeholders:

git checkout -b $ newbranchname $ oldbranchname

This was the proposed format based on the github cheat map presented here: http://bit.ly/WXRGN

Unfortunately, I get this error message: fatal: not a git repository (or any of the parent directories): git.

Please help, I really do not know what is happening. Do I need to point to a directory or something in the branch name? Any information is greatly appreciated.

+3
source share
1 answer

Use cdto move to the directory where your repo is located.

how

$ ls
foo bar baz myRepo
$ cd myRepo
$ ls -a
src README make .git

The record .gitshows that there is a repository in this directory. You can only issue the git command for the repo from this directory or any subdirectories.

+3
source

Source: https://habr.com/ru/post/1765469/


All Articles