> For the complete documentation index, see [llms.txt](https://antoinearnoud-2.gitbook.io/git-for-economists/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://antoinearnoud-2.gitbook.io/git-for-economists/page-1.md).

# Page 1

## Using Remote Repository

### Clone repository <a href="#clone-repository" id="clone-repository"></a>

Get the link to your repo on github and typegit clone link\_to\_your\_repo\_hereit will **create** a new folder with all the content of your remote repo.

### Create branches <a href="#create-branches" id="create-branches"></a>

To create a local branch that **tracks** a branch on the remote repo:git checkout -b LocalName origin/remotebranchnameTo cancel all the change and start fresh from the remote point of the branch:`git push origin HEAD --force`To create an upstream branch (origin is the name of the remote repo, branch the name of the branch)git push -u origin local-branchgit push --set-upstream-to remote/branchHaving an upstream branch registered for a local branch will:

* tell git to **show the relationship between the two branches in `git status` and `git branch -v`**.
* directs **`git pull`** ***without arguments*****&#x20;to pull from the upstream when the new branch is checked out**.

To see all the current remote branch, type `git remote -v` . Best, use:git fetch --all; git branch -vv

### Pull, Commit, Push <a href="#pull-commit-push" id="pull-commit-push"></a>

After work on the local files is done, commit:git add files\_to\_addgit commit -m "commit comment here"git push originBefore working on anything new, make sure to pull any change from the central repositorygit pull originYou can also just check if there are any changes by fetching the information. This will not affect any file, just let you know if some files on the remote repository are different than the files on your local machinegit fecth --all`git pull` is essentially a `git fetch` immediately followed by a `git merge`

### Commits <a href="#commits" id="commits"></a>
