Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,551,671
Community Members
 
Community Events
184
Community Groups

Technical Issue: Git hates me and won't let me push my repositories

@mention Good morning all!  I have an issue with my git.  I've been trying to push a branch of one of my repositories to my remote bitbucket repository, but it's not working.  I didn't use the sourceTree GUI to do it, I've been using the terminal and the git cli so that I can get familiar with the commands.  I made sure I was in the right directory and pushed the branch the way it said to in the documentation:

cd ~//repos

/*

to make sure I was in the right directory.  I used two forward slashes just in case I was more than one directory above where I needed to be(ie, ., ./)

*/

git push on-off-premise middle_child

/*

middle_child is the name of a child branch merged into  my master branch(i didn't call it main)

*/

 

It keeps saying the remote repository can't read the file. It's telling me to make sure I have permission and that the file exist.  I know I have the permissions.  I know the file exist.  When I look at the remote repository, the one in bitbucket, the branch I'm trying to push isn't there.  I tried with files.  putting the filename where the branch name was.  got error messages.  What am I doing wrong?

 

1 answer

1 accepted

1 vote
Answer accepted
Craig Nodwell
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 07, 2023

Hi @Mia Paulin 

cd to your git directory 
git add --all
git commit -m "jira-id if you have one then your message"
git push --all <path to repo> no branch name here just the path to the repo
re: git push --all https://mybitbucket.com/myorg/myrepo.git TIP use the path you get from the clone string.

git push origin usually should work fine but I don't what you have in your git-config so just use the full path back to the repo

@Craig Nodwell  So, if I added a remote repository to my home pc using

git remote add <remote> <url>

can't I just use the name of the remote repository?

git remote add -all <remote name>

I mean 

/*

git push -all <remote>

*/

Like Craig Nodwell likes this
Craig Nodwell
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 07, 2023

Yes but not exactly like that :)
You have to do the add, then the commit, then the push -> which can use the remote setting.

You add the files you want(in a GUI client this would be your stagged files).
You commit those stagged files, this is where you add your commit message.
You push that commit to the remote, this is where you get your changes into the remote.

In your repository directory as above.

The git remote add command takes two arguments:

  • A unique remote name, for example, “my_repo”

  • A remote URL, the one you used to clone the repo

After you create it you can verify it with
git remote -v

Then you can use git push --all(this --all is optional) remoteName

then you add your files to your stagging area for the commit 
git add filename(for single file) or . or --all for everything
git commit -m "to add a message to the commit"
git push remoteName

git push --all allows a user to push all changes and not just a single commit or branch 

Like Mia Paulin likes this

@Craig Nodwell  Thanks!  That helps out a lot!

Craig Nodwell
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 07, 2023

You're welcome.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events