0% found this document useful (0 votes)
134 views2 pages

Basic Git Commands - Atlassian Documentation

This document lists some basic Git commands for getting started with Git. It describes commands for initializing a local repository, checking out a repository, adding and committing files, pushing changes to a remote repository, checking the status of files, and connecting a local repository to a remote server.

Uploaded by

pooja
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
134 views2 pages

Basic Git Commands - Atlassian Documentation

This document lists some basic Git commands for getting started with Git. It describes commands for initializing a local repository, checking out a repository, adding and committing files, pushing changes to a remote repository, checking the status of files, and connecting a local repository to a remote server.

Uploaded by

pooja
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 2

Basic Git commands - Atlassian Documentation https://confluence.atlassian.com/bitbucketserver/basic-git-co...

Basic Git commands


Here is a list of some basic Git commands to get you going with Git.

For more detail, check out the  Atlassian Git Tutorials  for a visual introduction to Git commands and workflows, including examples.

Git task Notes Git commands

Tell Git who you are Configure the author name and email address to be used with your commits. git config --global user.name "Sam Smith"
Note that Git strips some characters (for example trailing periods) from user.name.
git config --global user.email sam@example.com

Create a new local git init


repository

Check out a repository Create a working copy of a local repository: git clone /path/to/repository

For a remote server, use: git clone username@host:/path/to/repository

Add files Add one or more files to staging (index): git add <filename>

git add *

Commit Commit changes to head (but not yet to the remote repository): git commit -m "Commit message"

Commit any files you've added with git add, and also commit any files you've changed git commit -a
since then:

Push Send changes to the master branch of your remote repository: git push origin master

Status List the files you've changed and those you still need to add or commit: git status

Connect to a remote If you haven't connected your local repository to a remote server, add the server to be able git remote add origin <server>
repository to push to it:

1 of 2 13/02/19, 12:39
Basic Git commands - Atlassian Documentation https://confluence.atlassian.com/bitbucketserver/basic-git-co...

2 of 2 13/02/19, 12:39

You might also like