Set up a lab for experimenting with GIT

I am a newbie (like 6 months old) Linux user.

I have been using Git for quite some time, and now I would like to start learning more complex things. What I would like to learn are the various ways of processing and controlling the remote control.

So my question is: how can I configure "remote" locally? Is it possible to create two folders, for example:

/home/my_user/git_experiment/remote_branch
/home/my_user/git_experiment/local_branch 

and set the folder local_branchto track the folder remote_branchin the same way as if there remote_branchwas a repo on GitHub?

+3
source share
2 answers

- , . git http ( ) ssh https ( ), . , , :

# clone project into project2
git clone project project2

2, , . , project2, , .

, , :

# the .git suffix is traditional for bare repos, since they're
# basically the .git directory of a normal repo
git clone --bare project project.git
cd project
git remote add bare-remote ../project.git
# now you've got a remote to push to

, "local_brach" "remote_brach" ( ""?). . ; , , .

+3

, <url> git remote :

$ git remote add my-remote /home/my_user/git_experiment/remote_brach
+1

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


All Articles